Frequently Asked Questions

What is the maximum allowed time difference between the timestamp parameter and the server time? When the server receives a request, it checks the timestamp in the request. If the request was sent more than 5000 milliseconds earlier, it will be considered invalid. You can customize this time window by sending the optional parameter recvWindow.

How to resolve the error “Request header 'X-CH-TS' cannot be empty”? First, we recommend printing the value of X-CH-TS. When an exception occurs, check whether X-CH-TS is empty. We also suggest optimizing the code to always check that X-CH-TS is not empty before sending a request.

Why does signature authentication always return "invalid signature"? You can print the request header and the string before signing. Focus on the following key points:

Compare your request headers with the example below:

Header Example:

Content-Type: application/json

X-CH-APIKEY: 44c541a1---****-10fe390df2

X-CH-SIGN: ssseLeefrffraoEQ3yI9qEtI1CZ82ikZ4xSG5Kj8gnl3uw=

X-CH-TS: 1574327555669 Make sure the API key is correctly configured in your code.

Check whether the pre-signature string is correctly formatted. All elements must appear in the correct order. You can compare it with the following examples:

GET Example: 1588591856950GET/sapi/v1/account

POST Example: 1588591856950POST/sapi/v1/order/test{"symbol":"BTCUSDT","price":"9300","volume":"1","side":"BUY","type":"LIMIT"} What does the error ILLEGAL_CONTENT_TYPE (-1017) mean when calling an API? We recommend including the header Content-Type: application/json in all requests.

Is there a limit on the number of API calls per second? Yes. Please refer to the rate limits specified for each endpoint in the documentation.

What is the basis for API rate limits? Rate limits for private data are based on your API key, while limits for public data are based on your IP address. If you include valid user credentials when accessing public data, the rate limit will be based on your API key.

What causes HTTP status code 429? It means the request frequency exceeded the allowed rate limit. Try lowering the frequency of your requests.

Will exceeding the API rate limit result in an IP ban? How long does it last? Generally, it will not result in a ban. Simply reduce your request frequency.

Why does the WebSocket connection get disconnected? No heartbeat was sent. WebSocket connections require the client to respond with a pong to maintain the connection.

Due to network issues, the client may send a pong, but the server does not receive it. Other network issues can also cause automatic disconnection.

We recommend implementing a WebSocket reconnection mechanism so the program can automatically reconnect in case of unexpected disconnection due to heartbeat failure.

Why does a request return a “Time Out” error? It means the client cannot connect to the server. Please check your network connectivity.

How to retrieve all trading pairs on the platform? You can use the /sapi/v1/symbols endpoint for spot trading pairs.

Is there a limit on the number of orders in a batch submit/cancel request? Yes. Batch order interfaces are limited to 10 orders per request.

What is newClientOrderId and what is it used for? newClientOrderId is a user-defined order ID used to uniquely identify an order. After placing an order, you can use newClientOrderId with the order query endpoint to check its status.

Users must ensure the uniqueness of this ID. The system does not deduplicate. If duplicate IDs are used, only the most recent one will be available for cancellation or query.

How to get the latest trade price? You can obtain it via the ticker info — the last field represents the latest trade price.

Can the 24-hour volume in the ticker endpoint show negative growth? Yes. Since the 24-hour volume is a rolling metric (with a 24-hour sliding window), it is possible for the cumulative volume or turnover in a new window to be lower than the previous one.

Last updated