-
Notifications
You must be signed in to change notification settings - Fork 87
012security_authorization
- All requests based on the Https protocol should set the request header information Content-Type as:'application/json’.
- All input and output data are in JSON format.
- Visit Root URL: https://api.coinex.com/v1
- Signature is required for Account API and trading API related interfaces. The signature data is placed in the authorization header of the HTTP header and authorization is the signature result string. No signature is required for market API related interfaces.
- Request header information must be declared: User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36
- Rate limit: Please refer to the specific instruction of each interface. The general speed limit of the sockets is 200 times per 10 second per IP (for Trading and Account API); no limit on Market API
# to CoinEx before invoking API and get Acquire access_id/secret_key in Account > API.
access_id: To mark identity of API invoker
secret_key: Key to sign the request parameters
Note: access_id/secret_key is equivalent to your account/password. For your asset security, please keep it safe and change it regularly. Once lost, please # to CoinEx for reset.
Request parameters should include access_id and all parameters need to be signed.
E.g. Relevant parameters of a request are as follows:
POST:
{
"access_id": "4DA36FFC61334695A66F8D29020EB589",
"market": "BTCBCH",
"type" : "buy",
"price": "10",
"amount": "1.0",
"tonce": 1513746038205
};
GET:
access_id=4DA36FFC61334695A66F8D29020EB589&market=BTCBCH&type=buy&price=680&amount=1.0&tonce=1513746038205
Sort field names alphabetically as follows:
POST:
{
"access_id": "4DA36FFC61334695A66F8D29020EB589",
"amount": "1.0",
"market": "BTCBCH",
"price": "10",
"tonce": 1513746038205,
"type: "buy"
};
GET:
access_id=4DA36FFC61334695A66F8D29020EB589&amount=1.0&market=BTCBCH&price=680&tonce=1513746038205&type=buy
Use & match the sorted parameters as follows:
access_id=4DA36FFC61334695A66F8D29020EB589&amount=1.0&market=BTCBCH&price=680&tonce=1513746038205&type=buy
Add secret_key to the last string to sign, supposing this is a secret_key: B51068CF10B34E7789C374AB932696A05E0A629BE7BFC62F:
access_id=4DA36FFC61334695A66F8D29020EB589&amount=1.0&market=BTCBCH&price=680&tonce=1513746038205&type=buy&secret_key=B51068CF10B34E7789C374AB932696A05E0A629BE7BFC62F
Use MD5 algorithm to encrypt the signature string, convert encrypted result to uppercase, get signature data and put signature data in HTTP Header - authorization:
authorization: 610AB90A1D31D45901D173E4F59C9384
https://api.coinex.com/v1/market/list
# Response
{
"code": 0, # Refer to code error description.
"data": {}, # Return data as list or dictionary.
"message": "Ok" # Code error description.
}
Common API
Market API
-
Acquire Market List
-
Acquire Market Statistics
-
Acquire Market Depth
-
Acquire Latest Transaction Data
-
Acquire K-Line Data
-
Acquire Market Information
-
Acquire Single Market Information
-
Acquire AMM Market List
Account API
-
Inquire Account Info
-
Inquire Withdrawal List
-
Submit A Withdrawal Order
-
Cancel Withdrawal
-
Inquire Deposit List
-
Transfer between main account and sub account
-
Transfer between main account and margin account
-
Get deposit address
-
Generate deposit address
-
Inquire Sub Account Balance
-
Inquire Sub Account Balance History
-
Create Sub Account
-
Frozen Sub Account
-
Unfrozen Sub Account
-
Acquire Credit Account Info
Trading API
-
Place Limit Order
-
Place Multiple Limit Orders
-
Place Market Order
-
Place Stop Limit Order
-
Place IOC Order
-
Acquire Unexecuted Order List
-
Acquire Executed Order List
-
Acquire Order Status
-
Acquire Multiple Orders Status
-
Acquire Executed Order Detail
-
Acquire User Deals
-
Cancel Order
-
Cancel Multiple Orders
-
Cancel All Orders
Margin API
-
Inquire Margin Account Info
-
Inquire Margin Account Market Info
-
Inquire Margin Account of A Currency
-
Acquire Margin Account Settings
-
Acquire Margin Account Settings of A Currency
-
Acquire Loan List
-
Place Loan
-
Place Flat
-
Margin Balance Transfer
Contract API