Basic information
- Spot API URL: https://openapi.odyssey.trade
- Futures API URL: https://futuresopenapi.odyssey.trade
- WebSocket API URL: wss://ws.odyssey.trade/kline-api/ws
- All endpoints return either a JSON object or array.
- Data is returned in reverse order. Newest first, oldest last.
- All time and timestamp related fields are in milliseconds.
-
All requests are based on the
HTTPS
protocol, and theContent-Type
should beapplication/json
-
For the interface of the
GET
method, the parameters must be sent in thequery string
-
The interface of the
POST
method, the parameters must be sent in therequest body
- Parameters may be sent in any order.
HTTP Error Codes
HTTP4XX
return codes are used for malformed requests; the issue is on the sender’s side.
HTTP 418
return code is used when an IP has been auto-banned for continuing to send requests after receiving 429
codes.
HTTP 429
return code is used when breaking a request rate limit.
HTTP 5XX
return codes are used for internal errors
HTTP 504
return 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:
Endpoint Security Type
Each endpoint has a security type that determines the how you will interact with it. API key are passed into the Rest API via theX-CH-APIKEY
header.
API keys and secret keys are case sensitive.
- 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.
Timing Security
The signature interface needs to pass the timestamp in theX-CH-TS
field 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 after timestamp the request is valid for. If recvWindow
is not sent, it defaults to 5000.
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
of 5000 or less!
Signature
Requests with theTrade
and USER_DATA
level must be signed. The signature is not case-sensitive and generated as follows:
{timestamp}{method}{path}{data}
- timestamp – current timestamp in milliseconds
- method –
GET
orPOST
- path – request path, example: /ping
- data –
query string
if method is GET elsebody data