BitMEX documents its API using the Swagger/OpenAPI Specification.
The basic structure of an API response is documented in the API Explorer, which is generated by this specification. All responses are application/json.
In general, expect results to be either a plain object or array of objects corresponding to the particular endpoint. The same object shape is used for table retrieved from the WebSocket.
If an error is thrown, the error is of the shape:
{"error": {
"message": "...",
"name": "HTTPError" | "ValidationError" | "WebsocketError" | "Error"
}}
A full list of possible errors is below. Note that throwing too many errors in a short period of time is grounds for a temporary IP or account ban.
Note: In these cases, the order will be returned with an
ordRejReason
.