XBTXBCXBJZECETHETCXMRXRPREPLTCFCTDASHCOINRecentAllXBTUSD1223.69+2.77%XBTH171260.00+2.69%DASH7D0.031834+18.95%ETH7D0.01284-0.85%XBJH17145992+4.12%XMR7D0.010339+4.07%XBCH178367.4+3.28%ETC7D0.001143+9.17%FCT7D0.002491-1.54%ZECH170.030304-4.70%XRP7D0.00000442-5.56%COIN_BH1750.00+11.11%REP7D0.003867-0.08%LTC7D0.00320-0.31%XBT/USD Spot1221.28+2.58%XBT/CNY Spot7962.33+1.74%XBT/JPY Spot142366.01+2.51%ETH/XBT Spot0.01290+0.00%ZEC/XBT Spot0.0324900+1.35%24H XBT Volatility2.12-31.17%Funding:  @ 0.0111%Time:
REST API

Reference Connectors

For working code and examples, please see our HTTP Connectors on GitHub.

Using the BitMEX REST API

If you are logged in, you may access the API Key Management interface.

For a list of endpoints and return types, view the REST documentation in the API Explorer.

Specification and Clients

The BitMEX API conforms to the Swagger spec for REST endpoints. Any Swagger-compatible client can connect to the BitMEX API and execute commands.

An updated list of available clients is listed here.

Examples of basic communication to our API are in our api-connectors repository.

Authentication

To access private endpoints, a permanent API key is required.

Details about authentication via API Key are available via a separate document.

Currency

Note that all Bitcoin quantities are returned in Satoshis: 1 XBt (Satoshi) = 0.00000001 XBT (Bitcoin).

Filtering

Many table endpoints take a filter parameter. This is expected to be JSON. For example, the filter query {"side":"Buy"} can be url-encoded and sent to the trade endpoint (click to run).

Most values can only be filtered by simple equality. Timestamps, which are all UTC, can be queried in many ways:

Rate Limits

Requests to our REST API are rate limited to 300 requests per 5 minutes. This counter is reset every 5 minutes.

Be very careful about the number of errors your tools throw! If a large number of 4xx or 5xx responses are delivered in a short period of time, your IP may be banned for an hour. Multiple bans in a short time will result in a week ban.

Increasing Your Rate Limit

If you are running up against our limits and believe that you have a legitimate need, please email us at support@bitmex.com to discuss upgrading your access limits.

Before increasing your rate limits, we require that your programs at least:

  • Use the WebSocket feeds to avoid polling data.
  • Use our bulk order, bulk amend, and bulk cancel features to reduce load on the system.
    • Due to how BitMEX does real-time auditing, risk checks, and margining, orders submitted, amended, and canceled in bulk are faster to execute. For this reason, bulk actions are ratelimited at 1/10 the normal rate!
    • Bulk cancels, regardless of count, always only count as one request.

When emailing us about a ratelimit increase, please include:

  • Your application’s purpose and intended growth
  • Your desired rate limit
  • Acknowledgement that your program is using the API efficiently, as mentioned above.

HTTP Keep-Alive

BitMEX does not support placing or canceling orders via WebSocket, only via HTTP.

Our servers support HTTP Keep-Alive and cache SSL sessions. If you keep a connection alive, you will get websocket-like latency, obviating the need to use the websocket for transactional communication.

Our Keep-Alive timeout is 90 seconds.

Timestamp Filters

The following fields can be passed in the "filter" param as JSON key/value pairs:

Key Description Example Example Description
"startTime" Start timestamp. "2014-12-26 11:00" On or after 11:00am on 26 December 2014.
"endTime" End timestamp. "2014-12-26 13:00" On or before 1:00pm on 26 December 2014.
"timestamp" Exact timestamp. "2014-12-26 12:00" Exactly noon on 26 December 2014.
"timestamp.date" Exact day. "2014-12-26" The entire day of 26 December 2014.
"timestamp.month" Exact month. "2014-12" The entire month of December 2014.
"timestamp.year" Exact year. 2014 The entire year of 2014.
"timestamp.mm" Month of year. 12 December of each year.
"timestamp.dd" Day of month. 26 26th of each month.
"timestamp.ww" Day of week. 6 Friday of each week. 0 = Sat, 1 = Sun
"timestamp.time" Exact time. "12:00:00.000" Exactly noon of each day.
"timestamp.second" Exact second. "12:00:00" The entire second from noon of each day.
"timestamp.minute" Exact minute. "12:00" The entire minute from noon of each day.
"timestamp.hh" Hour of day. 12 12th hour of each day. (i.e. noon)
"timestamp.uu" Minute of hour. 30 30th minute of each hour.
"timestamp.ss" Second of minute. 15 15th second of each minute.

For example, the .BVOL7D index is calculated and published on the trade feed every 5 minutes. To filter to just noon on Fridays, send the payload:

{"symbol": ".BVOL7D", "filter": {"timestamp.time":"12:00", "timestamp.ww":6}}

(Click to run)