{"id":40870221,"url":"https://github.com/crypto-zero/go-binance","last_synced_at":"2026-01-22T00:39:22.733Z","repository":{"id":39311960,"uuid":"390954185","full_name":"crypto-zero/go-binance","owner":"crypto-zero","description":"binance rest API library (developing)","archived":false,"fork":false,"pushed_at":"2023-11-08T07:58:36.000Z","size":875,"stargazers_count":9,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T12:07:57.715Z","etag":null,"topics":["binance","blockchain"],"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/crypto-zero.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":"2021-07-30T06:18:36.000Z","updated_at":"2023-08-03T06:16:30.000Z","dependencies_parsed_at":"2024-06-20T11:17:45.636Z","dependency_job_id":null,"html_url":"https://github.com/crypto-zero/go-binance","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/crypto-zero/go-binance","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crypto-zero%2Fgo-binance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crypto-zero%2Fgo-binance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crypto-zero%2Fgo-binance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crypto-zero%2Fgo-binance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crypto-zero","download_url":"https://codeload.github.com/crypto-zero/go-binance/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crypto-zero%2Fgo-binance/sbom","scorecard":{"id":310166,"data":{"date":"2025-08-11","repo":{"name":"github.com/crypto-zero/go-binance","commit":"14715923e61af5efd68a61c5760a633a9d0cbf15"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 2/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/crypto-zero/go-binance/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/crypto-zero/go-binance/go.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/go.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/crypto-zero/go-binance/go.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/go.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2022-0493 / GHSA-p782-xgp4-8hr8"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T23:02:52.961Z","repository_id":39311960,"created_at":"2025-08-17T23:02:52.962Z","updated_at":"2025-08-17T23:02:52.962Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28648460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T21:29:11.980Z","status":"ssl_error","status_checked_at":"2026-01-21T21:24:31.872Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["binance","blockchain"],"created_at":"2026-01-22T00:39:22.629Z","updated_at":"2026-01-22T00:39:22.724Z","avatar_url":"https://github.com/crypto-zero.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"### go-binance\n\nA Golang SDK for [binance](https://www.binance.com) API.\n\n[![Build Status](https://travis-ci.org/crypto-zero/go-binance.svg?branch=master)](https://travis-ci.org/crypto-zero/go-binance)\n[![GoDoc](https://godoc.org/github.com/crypto-zero/go-binance?status.svg)](https://godoc.org/github.com/crypto-zero/go-binance)\n[![Go Report Card](https://goreportcard.com/badge/github.com/crypto-zero/go-binance)](https://goreportcard.com/report/github.com/crypto-zero/go-binance)\n[![codecov](https://codecov.io/gh/crypto-zero/go-binance/branch/master/graph/badge.svg)](https://codecov.io/gh/crypto-zero/go-binance)\n\nAll the REST APIs listed in [binance API document](https://github.com/binance-exchange/binance-official-api-docs) are implemented, as well as the websocket APIs.\n\nFor best compatibility, please use Go \u003e= 1.8.\n\nMake sure you have read binance API document before continuing.\n\n### API List\n\nName | Description | Status\n------------ | ------------ | ------------\n[rest-api.md](https://github.com/binance-exchange/binance-official-api-docs/blob/master/rest-api.md) | Details on the Rest API (/api) | \u003cinput type=\"checkbox\" checked\u003e Implemented\n[web-socket-streams.md](https://github.com/binance-exchange/binance-official-api-docs/blob/master/web-socket-streams.md) | Details on available streams and payloads | \u003cinput type=\"checkbox\" checked\u003e  Implemented\n[user-data-stream.md](https://github.com/binance-exchange/binance-official-api-docs/blob/master/user-data-stream.md) | Details on the dedicated account stream | \u003cinput type=\"checkbox\" checked\u003e  Implemented\n[margin-api.md](https://github.com/binance-exchange/binance-official-api-docs/blob/master/margin-api.md) | Details on the Margin API (/sapi) | \u003cinput type=\"checkbox\" checked\u003e  Implemented\n[futures-api.md](https://binance-docs.github.io/apidocs/futures/en/#general-info) | Details on the Futures API (/fapi) | \u003cinput type=\"checkbox\" checked\u003e  Partially Implemented\n[delivery-api.md](https://binance-docs.github.io/apidocs/delivery/en/#general-info) | Details on the Coin-M Futures API (/dapi) | \u003cinput type=\"checkbox\" checked\u003e  Partially Implemented\n\n### Installation\n\n```shell\ngo get github.com/crypto-zero/go-binance/v2\n```\n\n### Importing\n\n```golang\nimport (\n    \"github.com/crypto-zero/go-binance/v2\"\n)\n```\n\n### Documentation\n\n[![GoDoc](https://godoc.org/github.com/crypto-zero/go-binance?status.svg)](https://godoc.org/github.com/crypto-zero/go-binance)\n\n### REST API\n\n#### Setup\n\nInit client for API services. Get APIKey/SecretKey from your binance account.\n\n```golang\nvar (\n    apiKey = \"your api key\"\n    secretKey = \"your secret key\"\n)\nclient := binance.NewClient(apiKey, secretKey)\nfuturesClient := binance.NewFuturesClient(apiKey, secretKey)    // USDT-M Futures\ndeliveryClient := binance.NewDeliveryClient(apiKey, secretKey)  // Coin-M Futures\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.\n\nFollowing are some simple examples, please refer to [godoc](https://godoc.org/github.com/crypto-zero/go-binance) for full references.\n\n#### Create Order\n\n```golang\norder, err := client.NewCreateOrderService().Symbol(\"BNBETH\").\n        Side(binance.SideTypeBuy).Type(binance.OrderTypeLimit).\n        TimeInForce(binance.TimeInForceTypeGTC).Quantity(\"5\").\n        Price(\"0.0030000\").Do(context.Background())\nif err != nil {\n    fmt.Println(err)\n    return\n}\nfmt.Println(order)\n\n// Use Test() instead of Do() for testing.\n```\n\n#### Get Order\n\n```golang\norder, err := client.NewGetOrderService().Symbol(\"BNBETH\").\n    OrderID(4432844).Do(context.Background())\nif err != nil {\n    fmt.Println(err)\n    return\n}\nfmt.Println(order)\n```\n\n#### Cancel Order\n\n```golang\n_, err := client.NewCancelOrderService().Symbol(\"BNBETH\").\n    OrderID(4432844).Do(context.Background())\nif err != nil {\n    fmt.Println(err)\n    return\n}\n```\n\n#### List Open Orders\n\n```golang\nopenOrders, err := client.NewListOpenOrdersService().Symbol(\"BNBETH\").\n    Do(context.Background())\nif err != nil {\n    fmt.Println(err)\n    return\n}\nfor _, o := range openOrders {\n    fmt.Println(o)\n}\n```\n\n#### List Orders\n\n```golang\norders, err := client.NewListOrdersService().Symbol(\"BNBETH\").\n    Do(context.Background())\nif err != nil {\n    fmt.Println(err)\n    return\n}\nfor _, o := range orders {\n    fmt.Println(o)\n}\n```\n\n#### List Ticker Prices\n\n```golang\nprices, err := client.NewListPricesService().Do(context.Background())\nif err != nil {\n    fmt.Println(err)\n    return\n}\nfor _, p := range prices {\n    fmt.Println(p)\n}\n```\n\n#### Show Depth\n\n```golang\nres, err := client.NewDepthService().Symbol(\"LTCBTC\").\n    Do(context.Background())\nif err != nil {\n    fmt.Println(err)\n    return\n}\nfmt.Println(res)\n```\n\n#### List Klines\n\n```golang\nklines, err := client.NewKlinesService().Symbol(\"LTCBTC\").\n    Interval(\"15m\").Do(context.Background())\nif err != nil {\n    fmt.Println(err)\n    return\n}\nfor _, k := range klines {\n    fmt.Println(k)\n}\n```\n\n#### List Aggregate Trades\n\n```golang\ntrades, err := client.NewAggTradesService().\n    Symbol(\"LTCBTC\").StartTime(1508673256594).EndTime(1508673256595).\n    Do(context.Background())\nif err != nil {\n    fmt.Println(err)\n    return\n}\nfor _, t := range trades {\n    fmt.Println(t)\n}\n```\n\n#### Get Account\n\n```golang\nres, err := client.NewGetAccountService().Do(context.Background())\nif err != nil {\n    fmt.Println(err)\n    return\n}\nfmt.Println(res)\n```\n\n#### Start User Stream\n\n```golang\nres, err := client.NewStartUserStreamService().Do(context.Background())\nif err != nil {\n    fmt.Println(err)\n    return\n}\nfmt.Println(res)\n```\n\n### Websocket\n\nYou don't need Client in websocket API. Just call binance.WsXxxServe(args, handler, errHandler).\n\n\u003e For delivery API you can use `delivery.WsXxxServe(args, handler, errHandler)`.\n\n#### Depth\n\n```golang\nwsDepthHandler := func(event *binance.WsDepthEvent) {\n    fmt.Println(event)\n}\nerrHandler := func(err error) {\n    fmt.Println(err)\n}\ndoneC, stopC, err := binance.WsDepthServe(\"LTCBTC\", wsDepthHandler, 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#### Kline\n\n```golang\nwsKlineHandler := func(event *binance.WsKlineEvent) {\n    fmt.Println(event)\n}\nerrHandler := func(err error) {\n    fmt.Println(err)\n}\ndoneC, _, err := binance.WsKlineServe(\"LTCBTC\", \"1m\", wsKlineHandler, errHandler)\nif err != nil {\n    fmt.Println(err)\n    return\n}\n\u003c-doneC\n```\n\n#### Aggregate\n\n```golang\nwsAggTradeHandler := func(event *binance.WsAggTradeEvent) {\n    fmt.Println(event)\n}\nerrHandler := func(err error) {\n    fmt.Println(err)\n}\ndoneC, _, err := binance.WsAggTradeServe(\"LTCBTC\", wsAggTradeHandler, errHandler)\nif err != nil {\n    fmt.Println(err)\n    return\n}\n\u003c-doneC\n```\n\n#### User Data\n\n```golang\nwsHandler := func(message []byte) {\n    fmt.Println(string(message))\n}\nerrHandler := func(err error) {\n    fmt.Println(err)\n}\ndoneC, _, err := binance.WsUserDataServe(listenKey, wsHandler, errHandler)\nif err != nil {\n    fmt.Println(err)\n    return\n}\n\u003c-doneC\n```\n\n#### Setting Server Time\n\nYour system time may be incorrect and you may use following function to set the time offset based off Binance Server Time:\n\n```golang\n// use the client future for Futures\nclient.NewSetServerTimeService().Do(context.Background())\n```\n\nOr you can also overwrite the `TimeOffset` yourself:\n\n```golang\nclient.TimeOffset = 123\n```\n\n### Testnet\n\nYou can use the testnet by enabling the corresponding flag.\n\n\u003e Note that you can't use your regular API and Secret keys for the testnet. You have to create an account on\n\u003e the testnet websites : [https://testnet.binancefuture.com/](https://testnet.binancefuture.com/) for futures and delivery\n\u003e or [https://testnet.binance.vision/](https://testnet.binance.vision/) for the Spot Test Network.\n\n#### Spot\n\nUse the `binance.UseTestnet` flag before calling the client creation and the websockets methods.\n\n```go\nimport (\n    \"github.com/crypto-zero/go-binance/v2\"\n)\n\nbinance.UseTestnet = true\nclient := binance.NewClient(apiKey, secretKey)\n```\n\n#### Futures (usd(s)-m futures)\n\nUse the `futures.UseTestnet` flag before calling the client creation and the websockets methods\n\n```go\nimport (\n    \"github.com/crypto-zero/go-binance/v2/futures\"\n)\n\nfutures.UseTestnet = true\nBinanceClient = futures.NewClient(ApiKey, SecretKey)\n```\n\n#### Delivery (coin-m futures)\n\nUse the `delivery.UseTestnet` flag before calling the client creation and the websockets methods\n\n```go\nimport (\n    \"github.com/crypto-zero/go-binance/v2/delivery\"\n)\n\ndelivery.UseTestnet = true\nBinanceClient = delivery.NewClient(ApiKey, SecretKey)\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrypto-zero%2Fgo-binance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrypto-zero%2Fgo-binance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrypto-zero%2Fgo-binance/lists"}