{"id":36496102,"url":"https://github.com/radovsky1/go-currencycom","last_synced_at":"2026-01-12T02:04:27.416Z","repository":{"id":65339091,"uuid":"586207925","full_name":"radovsky1/go-currencycom","owner":"radovsky1","description":"A Go SDK for Currency.com","archived":false,"fork":false,"pushed_at":"2023-07-06T21:45:15.000Z","size":43,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-20T16:50:36.475Z","etag":null,"topics":["api","binance","crypto","currencycom","exchange","golang","sdk"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/radovsky1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-07T10:23:28.000Z","updated_at":"2023-11-23T21:44:55.000Z","dependencies_parsed_at":"2024-06-20T16:35:43.740Z","dependency_job_id":"096ccf2d-13c7-41bb-87c7-cb4091b70c8d","html_url":"https://github.com/radovsky1/go-currencycom","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/radovsky1/go-currencycom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radovsky1%2Fgo-currencycom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radovsky1%2Fgo-currencycom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radovsky1%2Fgo-currencycom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radovsky1%2Fgo-currencycom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/radovsky1","download_url":"https://codeload.github.com/radovsky1/go-currencycom/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radovsky1%2Fgo-currencycom/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28331513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"online","status_checked_at":"2026-01-12T02:00:08.677Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","binance","crypto","currencycom","exchange","golang","sdk"],"created_at":"2026-01-12T02:01:27.227Z","updated_at":"2026-01-12T02:04:27.402Z","avatar_url":"https://github.com/radovsky1.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-currencycom\n\nA Go client library for the [Currency.com API](https://currency.com/ru/api/).\n\n[![GoDoc](https://godoc.org/github.com/radovsky1/go-currencycom?status.svg)](https://godoc.org/github.com/radovsky1/go-currencycom)\n[![Currency.com Swagger API](https://img.shields.io/badge/Currency.com-Swagger%20API-blue.svg)](https://apitradedoc.currency.com/swagger-ui.html#/)\n[![Go Report Card](https://goreportcard.com/badge/github.com/radovsky1/go-currencycom)](https://goreportcard.com/report/github.com/radovsky1/go-currencycom)\n### Installation\n\n```shell\ngo get github.com/radovsky1/go-currencycom\n```\n\n### Contribution\nThis project is fully inspired by [go-binance](https://github.com/adshao/go-binance).\nAll other materials are taken from the official [Currency.com API](https://currency.com/ru/api) documentation.\n\n### Importing\n```golang\nimport (\n    currencycom \"github.com/radovsky1/go-currencycom\"\n)\n```\n\n### REST API\n\n#### Setup\n\nInit client for API services. Get APIKey/SecretKey from your account.\n\n```golang\nvar (\n    apiKey = \"your api key\"\n    secretKey = \"your secret key\"\n)\ncurrencycom.UseDemo = true // use demo server\nclient := currencycom.NewClient(apiKey, secretKey)\n```\n\nA service instance stands for a REST API endpoint and is initialized by client.NewXXXService function.\n\nSimply call API in chain style. Call Do() in the end to send HTTP request and get response.\n\n#### Create Order\n\n```golang\norder, err := client.NewCreateOrderService().\n        Symbol(\"BTC/USD_LEVERAGE\").\n        Side(go_currencycom.SideTypeBuy).\n        Type(go_currencycom.OrderTypeLimit).\n        Quantity(0.03).\n        Price(15000).\n        Do(context.Background())\nif err != nil {\n    panic(err)\n}\nprintln(order.OrderID)\n```\n\n#### Fetch Order\n\n```golang\norder, err := client.NewGetOrderService().\n        Symbol(\"BTC/USD_LEVERAGE\").\n        OrderID(\"123456789\").\n        Do(context.Background())\nif err != nil {\n    panic(err)\n}\nprintln(order.OrderID)\n```\n\n#### Cancel Order\n\n```golang\norder, err := client.NewCancelOrderService().\n        Symbol(\"BTC/USD_LEVERAGE\").\n        OrderID(\"123456789\").\n        Do(context.Background())\nif err != nil {\n    panic(err)\n}\nprintln(order.OrderID)\n```\n\n#### List Open Orders\n\n```golang\nopenOrders, err := client.NewListOpenOrdersService().Do(context.Background())\nif err != nil {\n    fmt.Println(err)\n    return\n}\nfmt.Println(openOrders)\n```\n\n#### List Trading Positions\n\n```golang\npositions, err := client.NewListTradingPositionsService().Do(context.Background())\nif err != nil {\n    fmt.Println(err)\n    return\n}\nfmt.Println(positions)\n```\n\n#### Get Account Information\n\n```golang\naccount, err := client.NewGetAccountService().Do(context.Background())\nif err != nil {\n    fmt.Println(err)\n    return\n}\nfmt.Println(account)\n```\n\nThere are more services available, please check the source code.\n\n### Websocket API\n\nYou don't need Client in websocket API. Just call currencycom.WsXxxServe(args, handler, errHandler).\n\n#### Market Data\n\n```golang\nwsMarketDataHandler := func(event *currencycom.WsMarketDataEvent) {\n    fmt.Println(event)\n}\nerrHandler := func(err error) {\n    fmt.Println(err)\n}\ndoneC, stopC, err := currencycom.WsMarketDataServe(\"BTC/USD_LEVERAGE\", wsMarketDataHandler, errHandler)\nif err != nil {\n    fmt.Println(err)\n    return\n}\n// use stopC to exit\ngo func() {\n    time.Sleep(5 * time.Second)\n    stopC \u003c- struct{}{}\n}()\n// remove this if you do not want to be blocked here\n\u003c-doneC\n``` \n\n#### OHLC Market Data\n\n```golang\nwsOHLCMarketDataHandler := func(event *currencycom.WsOHLCMarketDataEvent) {\n    fmt.Println(event)\n}\nerrHandler := func(err error) {\n    fmt.Println(err)\n}\ndoneC, stopC, err := currencycom.WsOHLCMarketDataServe(\"BTC/USD_LEVERAGE\", wsOHLCMarketDataHandler, errHandler)\nif err != nil {\n    fmt.Println(err)\n    return\n}\n// use stopC to exit\ngo func() {\n    time.Sleep(5 * time.Second)\n    stopC \u003c- struct{}{}\n}()\n// remove this if you do not want to be blocked here\n\u003c-doneC\n```\n\n#### Trades\n\n```golang\nwsTradesHandler := func(event *currencycom.WsTradesEvent) {\n    fmt.Println(event)\n}\nerrHandler := func(err error) {\n    fmt.Println(err)\n}\ndoneC, stopC, err := currencycom.WsTradesServe(\"BTC/USD_LEVERAGE\", wsTradesHandler, errHandler)\nif err != nil {\n    fmt.Println(err)\n    return\n}\n// use stopC to exit\ngo func() {\n    time.Sleep(5 * time.Second)\n    stopC \u003c- struct{}{}\n}()\n// remove this if you do not want to be blocked here\n\u003c-doneC\n```\n\n### Feedback\n\nIf you have any questions/suggestions, please feel free to contact me.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradovsky1%2Fgo-currencycom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fradovsky1%2Fgo-currencycom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradovsky1%2Fgo-currencycom/lists"}