Build powerful trading applications, bots, and integrations with DEGX's comprehensive REST API and WebSocket streams.
Get started with DEGX API in minutes. Follow these simple steps to make your first API call.
Log into your DEGX account and navigate to API Management to generate your API key and secret.
Use our official SDKs for Python, JavaScript, Java, or make direct HTTP requests.
Use our sandbox environment to test your integration without risking real funds.
// Using fetch API
fetch('https://api.degx.com/api/v3/ping')
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
// Expected response:
// {}
import requests
response = requests.get('https://api.degx.com/api/v3/ping')
print(response.json())
# Expected response:
# {}
Secure your API requests using API keys and signature-based authentication.
| Header | Description | Required |
|---|---|---|
| X-MBX-APIKEY | Your API key | Yes |
| signature | HMAC SHA256 signature | Yes |
| timestamp | Current timestamp in milliseconds | Yes |
const crypto = require('crypto');
function createSignature(queryString, secret) {
return crypto
.createHmac('sha256', secret)
.update(queryString)
.digest('hex');
}
// Example for account info endpoint
const timestamp = Date.now();
const queryString = `timestamp=${timestamp}`;
const signature = createSignature(queryString, 'YOUR_API_SECRET');
const headers = {
'X-MBX-APIKEY': 'YOUR_API_KEY',
'Content-Type': 'application/json'
};
fetch(`https://api.degx.com/api/v3/account?${queryString}&signature=${signature}`, {
method: 'GET',
headers: headers
})
Access real-time market data including prices, order books, and trading history.
| Parameter | Type | Description | Required |
|---|---|---|---|
| symbol | STRING | Trading pair symbol (e.g., BTCUSDT) | No |
{
"symbol": "BTCUSDT",
"priceChange": "-94.99999800",
"priceChangePercent": "-95.960",
"weightedAvgPrice": "0.29628482",
"prevClosePrice": "0.10002000",
"lastPrice": "4.00000200",
"lastQty": "200.00000000",
"bidPrice": "4.00000000",
"askPrice": "4.00000200",
"openPrice": "99.00000000",
"highPrice": "100.00000000",
"lowPrice": "0.10000000",
"volume": "8913.30000000",
"quoteVolume": "15.30000000",
"openTime": 1499783499040,
"closeTime": 1499869899040,
"firstId": 28385,
"lastId": 28460,
"count": 76
}
Understand and manage API rate limits to ensure optimal performance.
| Header | Description |
|---|---|
| X-MBX-USED-WEIGHT-1M | Current weight used in the last 1 minute |
| X-MBX-ORDER-COUNT-10S | Current order count in the last 10 seconds |
| X-MBX-ORDER-COUNT-1D | Current order count in the last 24 hours |
Common questions and answers about DEGX API integration.
Monitor the rate limit headers in each response and implement exponential backoff when you approach the limits. Consider using WebSocket streams for real-time data instead of frequent REST API calls.
REST API is request-response based and suitable for occasional data fetching. WebSocket provides real-time streaming data and is more efficient for high-frequency updates like price ticks and order book changes.
Use our sandbox environment at https://testnet.degx.com with test API keys. The sandbox mimics the production environment but uses test funds, allowing you to develop and test without financial risk.
We provide official SDKs for JavaScript/Node.js, Python, and Java. However, our REST API can be used with any programming language that can make HTTP requests. Community-maintained SDKs are also available for other languages.
Implement automatic reconnection logic with exponential backoff. Monitor connection status and resubscribe to streams after reconnection. Always validate data integrity after reconnection.
Start integrating DEGX's powerful trading API into your applications. Access real-time market data, execute trades, and build advanced trading tools.