Frequently Asked Questions
Q1: Unable to withdraw funds even after adding the address to the whitelist
Causes:
1. The whitelist on the withdrawal page and the API withdrawal whitelist are independent of each other.
2. Addresses added via [Withdrawal Page] > [Withdrawal Address Management] are not applicable for API withdrawals.
Solution:
- Visit the API Withdrawal Whitelist Management Page: https://www.coinex.com/apikey
- Add the withdrawal address to the API-specific whitelist.
Q2: access_id not exist Error
Common Causes:
(1) Newly created API keys typically take about 10 minutes to become active. Calling the API immediately after creation may trigger this error.
(2) Incorrect access_id.
(3) Invalid signature verification.
(4) Incorrect request header.
Solution:
(1) Refer to the [CoinEx API Documentation] to learn how to construct an HTTP authentication request.
(2) Demo:
Q3: 3008/4001 service unavailable Error
Cause: This error may occur when canceling orders during periods of high server load.
Solution:
(1) Prioritize canceling important orders.
(2) Retry after 1-2 seconds.
(3) If the response returns code: 0 but the order is not canceled:
- Record the complete request and response.
- Contact customer support and provide the main/sub-account information for assistance.
Q4: Invalid Parameter Error
Cause: This usually occurs when the uploaded parameters do not match the types specified in the API documentation.
Solution: Taking the POST /spot/cancel-order endpoint as an example:
(1) Strictly compare the parameter names and types in the API documentation.
(2) Pay special attention to the differences between numeric and string types.
Q5: What are the API rate limits?
Rate limits are divided into short-term rate limits and long-term rate limits, which can be identified via the Response Header:
1. Short-Term Rate Limits: If the X-RateLimit-Limit value is greater than 0, the short-term rate limit has not been triggered.
The short-term limit uses a token bucket mechanism, with independent rate limits for main and sub-accounts.
- Common error after triggering: Code: 213, 4213
- Message: Please don't try too frequently.
2. Long-Term Rate Limits: If the X-RateLimit-LongPeriod-{period}-Remaining is returned, long-term rate limits have been triggered. The system evaluates the user’s request volume and quality to decide whether to impose limits on request totals over a longer period. After triggering, request rates for all endpoints (except order cancellation) will be limited to 1 request per second.
- Common error: Code: 213, 4213
- Additional judgment required via Response Header.
Other Common Questions
Q1: How to reduce API request latency?
The servers are deployed on AWS Tokyo and support cross-region load balancing. You can choose a nearby region to minimize latency.
Available zones:
- ap-northeast-1a
- ap-northeast-1c
- ap-northeast-1d
Q2: Is 2FA required for API withdrawals?
For security reasons:
1. Before using API withdrawals, you must log in and authorize via 2FA.
2. After adding withdrawal addresses to the [Withdrawal Whitelist], you can initiate API withdrawals without further 2FA verification.
Q3: Can withdrawal whitelist addresses be added via the API?
Currently, adding withdrawal whitelist addresses via the API is not supported. Please go to [API Management] > [Withdrawal Whitelist] to manually or batch add addresses.
Q4: Signature incorrect Error
Solutions:
1. Check whether the access_id and secret_key are configured correctly.
2. Verify whether the request body and the parameters used for signature generation are identical. Preprocess the request parameters as strings and ensure consistency before and after signing.
3. If a third-party library is used for signing, ensure it is properly configured.
Q5: Tonce check error - Correct tonce should be within one minute of the current time
Solution:
(1) Ensure that the timestamp for all API requests is in milliseconds.
Example:
(2) Verify that your computer has enabled automatic time synchronization.
Q6: How to retrieve the actual available balance and net value of a futures account?
(1) Use the /assets/futures/balance endpoint to retrieve the available field, which indicates the current available balance of the futures account.
(2) API endpoints do not currently support returning the account’s net value. The net value is the sum of realized and unrealized profits and losses.
(3) Unrealized profits and losses are not fixed values and may fluctuate with position changes. Manual calculations are required for precise results.
(4) For calculation formulas, refer to the “How to Calculate Linear Contract Equity and PNL” documentation.
Q7: How to process data returned by the WebSocket API?
The WebSocket API returns data in compressed JSON string format, which must be decompressed before use (e.g., using the gzip module).
Common Error:
utf-8 codec can't decode byte 0x8b in position 1: invalid start byte
Q8: What to do if a third-party tax platform reports an error?
V1 services were discontinued on September 25, 2024. The error may be due to the platform not upgrading their code to V2. Please contact the relevant tax platform for assistance.
Q9: How to confirm a successful WebSocket connection?
Upon successful subscription, a subscription result response will be received.
Subsequently, you will receive the subscribed message updates:
Q10: Why does the WebSocket connection disconnect automatically? How to maintain the connection?
(1) WebSocket disconnections are usually caused by network issues. Please check whether the network connection is stable.
(2) To maintain the WebSocket connection, you need to use server.ping to keep it alive.
(3) If there is no communication with the server for 1 minute, the WebSocket connection will automatically disconnect. It is recommended to set a sending interval within 60 seconds via the ping interface to keep the connection active.
For other API errors, please click HERE to contact customer support and provide the following information to help resolve the issue:
(1) The email of the main account or the username of the sub-account.
(2) Complete request and response details.
Important: Do NOT share the access_id and secret_key in error messages to avoid unnecessary losses.