Introduction
Welcome to Odyssey Exchange API documentation
Using the exchange API, you can do the following: get a list of all coins on the exchange, get the exchange rate of coins, create orders, close orders, get account balance and much more.
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
HTTP 4XX
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 the X-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 the X-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:
Serious trading is about timing. Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers. With 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!
Signature
Requests with the Trade
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
Then you have to hash this string using SHA512 secret key as a salt.
Signature Example
Body
Terminal