{"id":23140869,"url":"https://github.com/f0cii/bitmex-api","last_synced_at":"2025-08-17T13:31:33.849Z","repository":{"id":44749925,"uuid":"180157275","full_name":"f0cii/bitmex-api","owner":"f0cii","description":"A Go wrapper to the BitMEX API","archived":false,"fork":false,"pushed_at":"2022-01-27T02:18:14.000Z","size":181,"stargazers_count":9,"open_issues_count":1,"forks_count":13,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-14T22:34:56.017Z","etag":null,"topics":["bitmex","bitmex-api","golang"],"latest_commit_sha":null,"homepage":null,"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/f0cii.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}},"created_at":"2019-04-08T13:39:25.000Z","updated_at":"2022-07-12T12:00:25.000Z","dependencies_parsed_at":"2022-09-10T03:20:57.332Z","dependency_job_id":null,"html_url":"https://github.com/f0cii/bitmex-api","commit_stats":null,"previous_names":["sumorf/bitmex-api","f0cii/bitmex-api","frankrap/bitmex-api"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/f0cii/bitmex-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0cii%2Fbitmex-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0cii%2Fbitmex-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0cii%2Fbitmex-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0cii%2Fbitmex-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f0cii","download_url":"https://codeload.github.com/f0cii/bitmex-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f0cii%2Fbitmex-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270856550,"owners_count":24657688,"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-08-17T02:00:09.016Z","response_time":129,"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":["bitmex","bitmex-api","golang"],"created_at":"2024-12-17T14:11:52.799Z","updated_at":"2025-08-17T13:31:33.581Z","avatar_url":"https://github.com/f0cii.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bitmex-api\nA Go wrapper to the BitMEX API\n\n### Example\n\n```\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/frankrap/bitmex-api\"\n\t\"github.com/frankrap/bitmex-api/swagger\"\n\t\"log\"\n)\n\nfunc main() {\n    b := bitmex.New(nil,\n        bitmex.HostTestnet, \"8K2Oi0bnRRZ7GK4UJnY-38oj\", \"9EmGvk8mKX5nWa11y1KyPPGn78Lv2ZEiLx3TH0YasE_oE06y\", true)\n\tsubscribeInfos := []bitmex.SubscribeInfo{\n\t\t{Op: bitmex.BitmexWSOrderBookL2, Param: \"XBTUSD\"},\n\t\t{Op: bitmex.BitmexWSOrder, Param: \"XBTUSD\"},\n\t\t{Op: bitmex.BitmexWSPosition, Param: \"XBTUSD\"},\n\t\t{Op: bitmex.BitmexWSMargin, Param: \"XBTUSD\"},\n\t}\n\terr := b.Subscribe(subscribeInfos)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tb.On(bitmex.BitmexWSOrderBookL2, func(m bitmex.OrderBookDataL2, symbol string) {\n\t\tob := m.OrderBook()\n\t\tfmt.Printf(\"\\rOrderbook Asks: %#v Bids: %#v                            \", ob.Asks[0], ob.Bids[0])\n\t}).On(bitmex.BitmexWSOrder, func(m []*swagger.Order, action string) {\n\t\tfmt.Printf(\"Order action=%v orders=%#v\\n\", action, m)\n\t}).On(bitmex.BitmexWSPosition, func(m []*swagger.Position, action string) {\n\t\tfmt.Printf(\"Position action=%v positions=%#v\\n\", action, m)\n\t}).On(bitmex.BitmexWSMargin, func(m []*swagger.Margin, action string) {\n\t\tfmt.Printf(\"Wallet action=%v margins=%#v\\n\", action, m)\n\t})\n\n\tb.StartWS()\n\n\t// Get orderbook by rest api\n\tb.GetOrderBook(10, \"XBTUSD\")\n\t// Place a limit buy order\n\tb.PlaceOrder(bitmex.SIDE_BUY, bitmex.ORD_TYPE_LIMIT, 0, 6000.0, 1000, \"\", \"\", \"XBTUSD\")\n\tb.GetOrders(\"XBTUSD\")\n\tb.GetOrder(\"{OrderID}\", \"XBTUSD\")\n\tb.AmendOrder(\"{OrderID}\", 6000.5)\n\tb.CancelOrder(\"{OrderID}\")\n\tb.CancelAllOrders(\"XBTUSD\")\n\tb.GetPosition(\"XBTUSD\")\n\tb.GetMargin()\n\n\tforever := make(chan bool)\n\t\u003c-forever\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff0cii%2Fbitmex-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff0cii%2Fbitmex-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff0cii%2Fbitmex-api/lists"}