{"id":20802508,"url":"https://github.com/go-numb/go-bitflyer","last_synced_at":"2025-10-05T05:19:44.864Z","repository":{"id":101820713,"uuid":"596679710","full_name":"go-numb/go-bitflyer","owner":"go-numb","description":"Crypto trade exchange API wrapper for Bitflyer with Go.","archived":false,"fork":false,"pushed_at":"2024-03-30T08:07:12.000Z","size":77,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-14T03:26:06.540Z","etag":null,"topics":["api","bitflyer","crypto","exchange","go","wrapper"],"latest_commit_sha":null,"homepage":"https://lightning.bitflyer.com/docs","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/go-numb.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}},"created_at":"2023-02-02T17:52:57.000Z","updated_at":"2025-01-06T04:40:24.000Z","dependencies_parsed_at":"2024-03-30T09:21:42.857Z","dependency_job_id":"9529449f-fa33-4ead-98a6-e111ebc0be77","html_url":"https://github.com/go-numb/go-bitflyer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/go-numb/go-bitflyer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-numb%2Fgo-bitflyer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-numb%2Fgo-bitflyer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-numb%2Fgo-bitflyer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-numb%2Fgo-bitflyer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-numb","download_url":"https://codeload.github.com/go-numb/go-bitflyer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-numb%2Fgo-bitflyer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278411261,"owners_count":25982368,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"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","bitflyer","crypto","exchange","go","wrapper"],"created_at":"2024-11-17T18:32:15.744Z","updated_at":"2025-10-05T05:19:44.843Z","avatar_url":"https://github.com/go-numb.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-bitflyer\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![GoDoc](https://godoc.org/github.com/go-numb/go-bitflyer?status.svg)](https://pkg.go.dev/github.com/go-numb/go-bitflyer)\n\n\n\nBitflyer exchange API version1, renew at 2023/02.\nUpdated for change FX to CFD at 2024/04/01.\n\n## Description\n\ngo-bitflyer is a go client library for [Bitflyer lightning API](https://lightning.bitflyer.com/docs).\n\n**Supported**\n- [x] All Public API\n- [x] All Private API\n- [x] GUI's Hidden API\n- [x] Websocket\n\n\n# Usage\n| Client   | Functions                                                                                     |\n| -------- | --------------------------------------------------------------------------------------------- |\n| Public   | Status(\u0026Request{}) (res, apiLimit, err)                                                       |\n| Public   | Helth(\u0026Request{}) (res, apiLimit, err)                                                        |\n| Public   | Ticker(\u0026Request{}) (res, apiLimit, err)                                                       |\n| Public   | Market(\u0026Request{}) (res, apiLimit, err)                                                       |\n| Public   | Board(\u0026Request{}) (res, apiLimit, err)                                                        |\n| Public   | Executions(\u0026Request{}) (res, apiLimit, err)                                                   |\n| Public   | Fr(\u0026Request{}) (res, apiLimit, err)                                                         |\n| Public   | Chat(\u0026Request{}) (res, apiLimit, err)                                                         |\n| Public   | LeverageC(\u0026Request{}) (res, apiLimit, err)                                                         |\n| Private  | Permissions(\u0026Request{}) (res, apiLimit, err)                                                  |\n| Private  | Balance(\u0026Request{}) (res, apiLimit, err)                                                      |\n| Private  | Collateral(\u0026Request{}) (res, apiLimit, err)                                                   |\n| Private  | CollateralAccounts(\u0026Request{}) (res, apiLimit, err)                                           |\n| Private  | Addresses(\u0026Request{}) (res, apiLimit, err)                                                    |\n| Private  | Coinins(\u0026Request{}) (res, apiLimit, err)                                                      |\n| Private  | Coinouts(\u0026Request{}) (res, apiLimit, err)                                                     |\n| Private  | Banks(\u0026Request{}) (res, apiLimit, err)                                                        |\n| Private  | Deposits(\u0026Request{}) (res, apiLimit, err)                                                     |\n| Private  | Withdrawals(\u0026Request{}) (res, apiLimit, err)                                                  |\n| Private  | ChildOrder(\u0026Request{}) (res, apiLimit, err)                                                   |\n| Private  | CancelChildOrder(\u0026Request{}) (res, apiLimit, err)                                             |\n| Private  | ParentOrder(\u0026Request{}) (res, apiLimit, err)                                                  |\n| Private  | CancelParentOrder(\u0026Request{}) (res, apiLimit, err)                                            |\n| Private  | Cancel(\u0026Request{}) (res, apiLimit, err)                                                       |\n| Private  | ChildOrders(\u0026Request{}) (res, apiLimit, err)                                                  |\n| Private  | DetailParentOrder(\u0026Request{}) (res, apiLimit, err)                                            |\n| Private  | MyExecutions(\u0026Request{}) (res, apiLimit, err)                                                 |\n| Private  | BalanceHistory(\u0026Request{}) (res, apiLimit, err)                                               |\n| Private  | Positions(\u0026Request{}) (res, apiLimit, err)                                                    |\n| Private  | CollateralHistory(\u0026Request{}) (res, apiLimit, err)                                            |\n| Private  | Commission(\u0026Request{}) (res, apiLimit, err)                                                   |\n| Hidden   | OHLCv(\u0026Request{}) (res, err)                                                                  |\n| Hidden   | Ranking(\u0026Request{}) (res, err)                                                                |\n| Realtime | Connect(\u0026auth, []string{\"channels\"...}, []string{\"product_codes...\"...}, chan Response) error |\n\n\n```go HTTP API\n\npackage main\n\nfunc main() {\n    client := bitflyer.New(\n\t\tos.Getenv(\"BF_KEY\"),\n\t\tos.Getenv(\"BF_SECRET\"))\n\n    results, managedApiLimit, err := client.Executions(\u0026public.Executions{\n        ProductCode: \"BTC_JPY\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    for _, v := range *results {\n        fmt.Println(v)\n        // -\u003e {2430391013 BUY 2.989057e+06 0.02 2025-01-01T08:47:20.577 JRF20250101-084720-050159 JRF20250101-084720-042209}...\n    }\n    fmt.Println(managedApiLimit.Remain)\n    // API Limit remain and more\n    // -\u003e 489\n\n\t// For Ohlcv and Ranking\n\thclient := hidden.New()\n\tohlcv, err := hclient.OHLCv(\u0026hidden.RequestOHLCv{\n        Symbo;: \"BTC_JPY\",\n\t\tPeriod: \"m\",\n    })\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    for _, v := range ohlcv {\n        fmt.Println(v)\n        // -\u003e O, H, L, C, V, Volume(1day), Y(null), Timestamp\n\t\t// 0: 3003659 3004234 3003143 3003503 3.131921 311.1 0 2023-02-01T21:01:00+09:00\n    }\n}\n\n\n```\n\n\n```go Realtime API with websocket\n\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\t\"time\"\n\n\t\"github.com/go-numb/go-bitflyer\"\n\t\"github.com/go-numb/go-bitflyer/public\"\n\t\"github.com/go-numb/go-bitflyer/realtime\"\n\t\"github.com/go-numb/go-bitflyer/types\"\n)\n\nfunc main() {\n\tclient := bitflyer.New(\n\t\t\"xxxxxxxxxxxxxxxxxxx\",\n\t\t\"xxxxxxxxxxxxxxxxxxxxxxxx=\")\n\n    // cancel goroutine from this function\n\tctx, cancel := context.WithCancel(context.Background())\n\tws := realtime.New(ctx)\n\tdefer ws.Close()\n\n    // recive data and notification form websocket\n\trecived := make(chan realtime.Response, 3)\n\t// This Connect is sharping binary data, to each struct.\n\t// There's also a class that handles raw data. use realtime\\raw.go\n\tgo ws.Connect(\n        // Connect to Private, if struct *Auth. \n\t\tclient.Auth, // or nil, when not subscribe to private channel\n\n        // input channel and product code, create request paramater in function\n\t\t[]string{\n\t\t\t\"executions\",\n\t\t\t\"ticker\",\n\t\t\t\"board\",\n\t\t},\n\t\t[]string{\n\t\t\ttypes.BTCJPY,\n\t\t},\n\t\trecived)\n\n\tgo Reciver(ctx, recived)\n\n    sig := make(chan os.Signal)\n    \u003c-sig\n\tcancel()\n\ttime.Sleep(time.Second)\n\tclose(recived)\n\n}\n\nfunc Reciver(ctx context.Context, ch chan realtime.Response) {\n\tdefer fmt.Println(\"func reciver was done\")\nL:\n\tfor {\n\t\tselect {\n\t\tcase \u003c-ctx.Done():\n\t\t\tbreak L\n\t\tcase v := \u003c-ch:\n\t\t\tswitch v.Types {\n\t\t\tcase realtime.TickerN:\n\t\t\t\tfmt.Print(v.ProductCode)\n\t\t\t\tfmt.Printf(\" ticker comming, %.0f\\n\", v.Ticker.Ltp)\n\t\t\tcase realtime.ExecutionsN:\n\t\t\t\tfmt.Print(v.ProductCode)\n\t\t\t\tfmt.Println(\" executions comming, id: \", v.Executions[0].ID)\n\t\t\tcase realtime.BoardSnapN:\n\t\t\t\tfmt.Print(v.ProductCode)\n\t\t\t\tfmt.Println(\" board snapshot comming, \", v.Board.MidPrice)\n\t\t\tcase realtime.BoardN:\n\t\t\t\tfmt.Print(v.ProductCode)\n\t\t\t\tfmt.Println(\" board update comming, \", len(v.Board.Asks), len(v.Board.Bids))\n\n\t\t\tcase realtime.ChildOrdersN:\n\t\t\t\tfmt.Println(\"child order comming, \", v.ChildOrders[0].ChildOrderID)\n\t\t\tcase realtime.ParentOrdersN:\n\t\t\t\tfmt.Println(\"parent order comming, \", v.ParentOrders[0].ParentOrderID)\n\n\t\t\tdefault:\n\t\t\t\t// can be detected by the receiver as such this loop, so it tells the receiver to terminate.\n\t\t\t\t// you can check contains \"scheduled maintenance\" into error.\n\t\t\t\tfmt.Printf(\"error or undefind: %#v\", v)\n\t\t\t}\n\n\t\t}\n\t}\n}\n\n\n```\n\n\n## Author\n\n[@_numbP](https://twitter.com/_numbP)\n\n## License\n\n[MIT](https://github.com/go-numb/go-bitflyer/blob/master/LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-numb%2Fgo-bitflyer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-numb%2Fgo-bitflyer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-numb%2Fgo-bitflyer/lists"}