Error Handling
In case of situations such as missing parameters, unauthorized access or server errors, the API will respond with an appropriate HTTP status code and the response body containing details in JSON-format.
List of common error codes
Section titled “List of common error codes”Code | Description |
---|---|
400 | Bad request |
401 | Unauthorized |
403 | Forbidden |
404 | Not found |
500 | Server error |
Rate Limiting
Section titled “Rate Limiting”To make sure that the API is not affected by misuse, requests will be rate limited. Every response will contain HTTP headers that will help caller to work within the limits.
If rate limit is exceeded, HTTP status code 429 (Too Many Requests) will be returned. In that case, you need to increase time between consecutive requests.
Example response
Section titled “Example response”HTTP/1.1 200 OKX-Hon-RateLimit-Limit: 20000X-Hon-RateLimit-Remaining: 9999
Response delivery
Section titled “Response delivery”HTTP response to any HTTP request sent to the endpoints described in this document may be gzipped if the client supports it (= sends header “Accept-Encoding: gzip,deflate” in request). The response will be gzipped if the response size exceeds 1400 bytes (otherwise it will fit into single TCP packet). The header Transfer-Encoding: chunked
is also added if the response is large enough.