Skip to Content
📈 Futures APIAPI Reference

API Reference

📋 Table of Contents


❌ Error Codes

Error Code Summary
Error CodeDescriptionSolution
100011Parameter errorCheck if request parameters are correct
410002Signature verification failedCheck if signature algorithm and secret key are correct
410001Invalid API KeyCheck if API Key is correct
410006Insufficient permissionsCheck API Key permission settings
Common Error Handling
1. Signature Verification Failed (410002)

Possible Causes:

  • Incorrect API Secret
  • Incorrect signature algorithm implementation
  • Incorrect parameter sorting
  • Incorrect timestamp or nonce format

Solutions:

  1. Check if API Secret is correct
  2. Verify signature algorithm implementation
  3. Ensure parameters are sorted in dictionary order
  4. Check timestamp and nonce format

📚 References

Official Resources
Third-party Resources
Development Tools
Programming Language Resources
JavaScript/Node.js
Java
Python

🔧 Technical Specifications

HTTP Status Codes
Status CodeDescription
200Request successful
400Request parameter error
401Authentication failed
403Insufficient permissions
404Resource not found
429Request rate limit exceeded
500Internal server error
502Gateway error
503Service unavailable
504Gateway timeout
Data Format
Request Format
  • Content-Type: application/json
  • Character encoding: UTF-8
  • Time format: Unix timestamp (milliseconds)
Response Format
{ "code": "0", "data": {}, "msg": "Request successful", "success": true, "timestamp": 1640995200000 }
Time Format
  • Timestamp: Unix timestamp, millisecond precision
  • Time String: ISO 8601 format (YYYY-MM-DDTHH:mm:ss.sssZ)
  • Time Zone: UTC time
Numeric Precision
  • Price: According to trading pair configuration precision
  • Quantity: According to trading pair configuration precision
  • Amount: According to coin configuration precision
  • Fee: According to coin configuration precision

🚀 Best Practices

1. Error Handling
try { const response = await apiRequest(endpoint, params); if (response.code === '0') { // Handle successful response handleSuccess(response.data); } else { // Handle business error handleBusinessError(response.code, response.msg); } } catch (error) { // Handle network error handleNetworkError(error); }
2. Retry Mechanism
async function makeRequestWithRetry(endpoint, params, maxRetries = 3) { for (let i = 0; i < maxRetries; i++) { try { return await apiRequest(endpoint, params); } catch (error) { if (i === maxRetries - 1) throw error; // Exponential backoff const delay = Math.pow(2, i) * 1000; await new Promise(resolve => setTimeout(resolve, delay)); } } }
3. Request Rate Limiting
class RateLimiter { constructor(maxRequests, timeWindow) { this.maxRequests = maxRequests; this.timeWindow = timeWindow; this.requests = []; } async throttle() { const now = Date.now(); this.requests = this.requests.filter(time => now - time < this.timeWindow); if (this.requests.length >= this.maxRequests) { const oldestRequest = this.requests[0]; const waitTime = this.timeWindow - (now - oldestRequest); await new Promise(resolve => setTimeout(resolve, waitTime)); } this.requests.push(now); } }
4. Logging
class ApiLogger { static log(level, message, data = {}) { const logEntry = { timestamp: new Date().toISOString(), level, message, data }; console.log(JSON.stringify(logEntry)); // Can send to log service if (level === 'ERROR') { this.sendToLogService(logEntry); } } }

📞 Technical Support

Contact Information
Support Hours
  • Weekdays: 9:00 - 18:00 (UTC+8)
  • Weekends: 10:00 - 16:00 (UTC+8)
  • Holidays: 10:00 - 16:00 (UTC+8)
Issue Reporting

If you encounter problems during use, please provide the following information:

  1. Error Description: Detailed description of the issue encountered
  2. Error Code: If there is an error code, please provide it
  3. Request Information: API endpoint, parameters, etc.
  4. Environment Information: Programming language used, version, etc.
  5. Log Information: Relevant error logs

📄 License

This documentation and related code examples are licensed under the MIT License.

MIT License

Copyright (c) 2024 BitTap

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Last updated on: