API Basic Information
-
Base URL:
https://openapi.idax.exchange - All endpoints return either a JSON object or an array.
- Data is returned in LIFO (Last in first out) order. newest first, oldest last.
- All time and timestamp related fields are in milliseconds.
HTTP Error Codes
-
HTTP
4XXreturn codes are used for malformed requests; the issue is on the sender’s side. - HTTP 410 return code is used when breaking a request rate limit.
- HTTP 418 means that if you continue to access after receiving 429, you will be blocked from IP, and the blocking time will be gradually extended from a minimum of 2 minutes to a maximum of 3 days for frequent violations of the restrictions.
-
HTTP
5XXreturn codes are used for internal errors -
HTTP
504return code is used when the API successfully sent the message but did not get a response within the timeout period. It is important to NOT treat this as a failure operation; the execution status is UNKNOWN and could have been a success. - All endpoints can possibly return an ERROR, the error payload is as follows:
General Information
-
All requests are based on the HTTPS protocol, and the
Content-Typein the request header information needs to be uniformly set to:'application/json' -
For
GETrequests, the parameters must be sent in theURL query parameters -
For
POSTrequests, the parameters must be sent in therequest body - Parameters may be sent in any order.
LIMITS
- Access restrictions are based on IP or UID, not API Key.
- The statistics by IP and by UID (account) are independent of each other.
- The total weight of single interface weight, according to IP statistics, is 12,000 per minute
- The total amount of interface weights by UID is 60,000 per minute
- Each interface will indicate whether the statistics are by IP or by UID, and the weight value of the corresponding request once
- There will be a limited frequency description below each interface.
- A 429 will be returned when either rate limit is violated.
Endpoint Security Type
- Each endpoint has a security type that determines how you will interact with it.
-
API-keys are passed into the REST API call via the
X-CH-APIKEYheader. - API-keys and secret-keys are case sensitive.
| Security Type | Description |
| NONE | Endpoint can be accessed freely. |
| TRADE | Endpoint requires sending a valid API-Key and signature. |
| USER_DATA | Endpoint requires sending a valid API-Key and signature. |
| USER_STREAM | Endpoint requires sending a valid API-Key. |
| MARKET_DATA | Endpoint requires sending a valid API-Key. |
SIGNED (TRADE 与 USER_DATA) endpoint security
-
When calling endpoints with security types of
TRADEorUSER_DATA, the signature should be passed in theX-CH-SIGNfield in the HTTP header. -
The signature uses the
HMAC SHA256algorithm. TheAPI-Secretcorresponding to the API-KEY is used as theHMAC SHA256key. -
Data to hash is a string concatenation of
timestamp+method+requestPath+body string. -
The value of
timestampis the same as theX-CH-TSrequest header (in milliseconds),methodis the request method in uppercase. -
requestPathis the request interface path For example:/sapi/v1/order. If the endpoint requires URL query parameters, they must be included inrequestPath, like/sapi/v1/order?symbol=BTCUSDT. -
bodyis the JSON string of the request body. - The signature is not case sensitive.
Timing Security
-
The signature interface needs to pass the timestamp in the
X-CH-TSfield in the HTTP header, and its value should be the unix timestamp of the request sending time e.g.1528394129373 -
An additional parameter,
recvWindow, may be sent to specify the number of milliseconds aftertimestampthe request is valid for. IfrecvWindowis not sent, it defaults to 1000. - In addition, if the server calculates that the client’s timestamp is more than one second ‘in the future’ of the server’s time, it will also reject the request.
- The logic is as follows:
recvWindow, you can specify that the request must be processed within a certain number of milliseconds or be rejected by the server.
It recommended to use a small recvWindow of 5000 or less!
SIGNED Endpoint Examples for POST /sapi/v1/order
Here is a step-by-step example of how to send a vaild signed payload from the Linux command line usingecho, openssl, and curl.
| Key | Value |
| apiKey | vmPUZE6mv9SD5V5e14y7Ju91duEh8A |
| secretKey | 902ae3cb34ecee2779aa4d3e1d226686 |
| Parameter | value |
| symbol | BTCUSDT |
| side | BUY |
| type | LIMIT |
| volume | 1 |
| price | 9300 |
Signature example
- body:
- HMAC SHA256 Signature:
- Curl command :