bitmexgo: a golang library for Bitmex REST APIs

I’ve open-sourced bitmexgo, a golang package that enables clients to call REST APIs for the Bitmex crypto trading platform. You may use it to analyze the most liquid crypto futures market or develop trading bots in Go.

Bitmex’s official golang library, which is automatically generated by swagger-codegen, turns out to be nonfunctional: due to its broken authentication flow, none of the APIs works at all. Ideally the bugs should be fixed at the swagger layer, but it appears to be a pretty thorny problem. Therefore I directly applied patches on top of the auto-generated code and created this new bitmexgo package.

In addition to bug fixes, I’ve rubbed out all external dependencies from the original code base to make bitmexgo leaner and self-contained.

To install the package, run the following shell command:

Apart from a few simplifications here and there, bitmexgo’s API adheres to the original interface quite faithfully. For example:

The swagger-generated code contains no tests, neither does the bitmexgo package. I have, however, manually tested many of its APIs in a side project without any issues.

As required by Bitmex, bitmexgo needs an API key/secret pair to work, which can be created at



drop me a line at

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store