General API Information

The base endpoint is: https://api.io.exchange All endpoints return either a JSON object or array. All time and timestamp related fields are in milliseconds. Request URL needs to be determined by BASE and specific endpoint combination.

Endpoint

Each interface has its own endpoint, described by field HTTP REQUEST in the docs.

Request

All requests and responses are application/json content type.

Endpoint security type

Each endpoint has a security type that determines the how you will interact with it. API-keys are passed into the Rest API via the API_KEY header. API-keys and secret-keys are case sensitive. For User data => Endpoint requires sending a valid API-Key and signature. For User stream => Endpoint requires sending a valid API-Key. TRADE and USER_DATA endpoints are SIGNED endpoints.

SIGNED (TRADE and USER_DATA) Endpoint security

SIGNED endpoints require an additional parameter, signature, to be sent in the query string or request body. Endpoints use HMAC SHA256 signatures. The HMAC SHA256 signature is a keyed HMAC SHA256 operation. Use your secretKey as the key and totalParams as the value for the HMAC operation. The signature is not case sensitive.

Timing security

A SIGNED endpoint also requires a parameter, timestamp, to be sent which should be the millisecond timestamp of when the request was created and sent. 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. The logic is as follows:

                if (timestamp < (serverTime + 1000) && (serverTime - timestamp) <= recvWindow) {
                  // process request
                } else {
                  // reject request
                }
            
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!

SIGNED Endpoint Examples for POST /api/v1/order

coin : BTC

apiKey : FcJXEbiSbFBOIJKVEMcdICdaRTiGHeNYhYc

secretKey : iPBUpOwOPrSmokZbnJpXxDfnMXZUHOFbTQwjejeVbhVujbliYo

queryString:

coin=BTC&recvWindow=5000&timestamp=1558088640489

HMAC SHA256 signature:

bf04aa37e7073ae88e6132bb41401811e55736d3191ae4a94e932968140f7a3f

signed querystring:

coin=BTC&recvWindow=5000&timestamp=1558088640489&signature=bf04aa37e7073ae88e6132bb41401811e55736d3191ae4a94e932968140f7a3f

General endpoints

Test connectivity

Http Request

GET /v1/api/ping

Response

                {
                    "msg": "Success",
                    "status": "1",
                    "info": {}
                }
                

Check server time

Http Request

GET /v1/api/time

Response

                {
                    "msg": "Success",
                    "status": "1",
                    "info": 1558089702000
                }
                

Order Book

Get a list of open orders for a symbol.

Http Request

GET /v1/api/orderbook

Request Parameter

pair : LTCBTC

count : 100 (Optional)

Response

                
               {
                    "msg": "Success",
                    "status": "1",
                    "info": {
                        "bids": [
                            {
                                "price": 0.017,
                                "volume": 3.4,
                                "total": 0.0578
                            },
                            {
                                "price": 0.018,
                                "volume": 3,
                                "total": 0.05399999
                            }
                        ],
                        "asks": [
                            {
                                "price": 0.027,
                                "volume": 9,
                                "total": 0.243
                            },
                            {
                                "price": 0.026,
                                "volume": 5,
                                "total": 0.13
                            }
                        ]
                    }
                }
                

Trade History

Http Request

GET /v1/api/tradehistory

Request Parameter

pair : LTCBTC

count : 100 (Optional)

Response

                    
                {
                    "msg": "Success",
                    "status": "1",
                    "info": [
                        {
                            "price": 0.022,
                            "volume": 0.3,
                            "time": 1557315914,
                            "side": "buy"
                        },
                        {
                            "price": 0.023,
                            "volume": 0.1,
                            "time": 1557315888,
                            "side": "sell"
                        }        
                    ]
                }
                

Last 24 hour Detail

Http Request

GET /v1/api/market

Request Parameter

pair : LTCBTC (optional)

Response

                {
                    "msg": "Success",
                    "status": "1",
                    "info": {
                        "Table": [
                            {
                                "TwentyHRVol": 0,
                                "TwentHRHigh": 0,
                                "TwentHRLow": 0,
                                "Pair": "LTCBTC",
                                "Coin": "LTC",
                                "Currency": "BTC",
                                "Price": 0.022,
                                "Volume": 0.3,
                                "ChangePer": 46.66666,
                                "ChangePrice": 0.007,
                                "VolBTC": 0,
                                "VolUSD": 0
                            }
                        ]
                    }
                }
            

Account endpoints(Signed API)

Get Balance

Http Request

POST /v1/api/balance

Request Parameters

coin : BTC

Response

                    
                {
                  msg: 'Success',
                  status: '1',
                  info: [
                    {
                      coin: 'BTC',
                      balance: 90.77753529,
                      onorders: 5.47373137,
                      pendingWithdraw: 0,
                      available: 85.30380392
                    }
                  ]
                }