API Documentation
Integrate with CryptoCoEX using our REST API. Access market data, manage orders, and build custom trading applications.
Base URL
https://api.cryptoexchange.com
API Version
Current version: v1
Response Format
All responses are returned in JSON format.
Some endpoints require authentication using API keys. You can generate API keys in your account settings.
Headers Required
Authorization: Bearer YOUR_API_KEY
X-API-Secret: YOUR_API_SECRET
Content-Type: application/json
Security Note: Never expose your API keys in client-side code. Use them only in server-side applications.
API endpoints have rate limits to ensure fair usage and system stability.
Public Endpoints
- • Market data: 100 requests/minute
- • Price data: 100 requests/minute
Private Endpoints
- • Account data: 60 requests/minute
- • Trading: 30 requests/minute
Rate limit headers are included in all responses: X-RateLimit-Limit
, X-RateLimit-Remaining
, X-RateLimit-Reset
/api/markets
Get market data for all cryptocurrencies
Rate limit: 100 requests/minute
/api/prices
Get current prices for all supported cryptocurrencies
Rate limit: 100 requests/minute
/api/portfolio/balances
Get user portfolio balances
Rate limit: 60 requests/minute
/api/orders
Place a new trading order
Rate limit: 30 requests/minute
/api/orders
Get order history
Rate limit: 60 requests/minute
/api/orders/:id
Cancel an open order
Rate limit: 30 requests/minute
javascript
// Get market data
const response = await fetch('https://api.cryptoexchange.com/api/markets');
const markets = await response.json();
// Place an order (authenticated)
const orderResponse = await fetch('https://api.cryptoexchange.com/api/orders', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
'X-API-Secret': 'YOUR_API_SECRET'
},
body: JSON.stringify({
symbol: 'BTC/USD',
side: 'buy',
type: 'limit',
amount: 0.01,
price: 42000
})
});
python
import requests
# Get market data
response = requests.get('https://api.cryptoexchange.com/api/markets')
markets = response.json()
# Place an order (authenticated)
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_API_KEY',
'X-API-Secret': 'YOUR_API_SECRET'
}
order_data = {
'symbol': 'BTC/USD',
'side': 'buy',
'type': 'limit',
'amount': 0.01,
'price': 42000
}
response = requests.post(
'https://api.cryptoexchange.com/api/orders',
headers=headers,
json=order_data
)
curl
# Get market data
curl https://api.cryptoexchange.com/api/markets
# Place an order (authenticated)
curl -X POST https://api.cryptoexchange.com/api/orders \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-API-Secret: YOUR_API_SECRET" \
-d '{
"symbol": "BTC/USD",
"side": "buy",
"type": "limit",
"amount": 0.01,
"price": 42000
}'
Successful Response
{
"success": true,
"data": {
"orderId": "12345",
"symbol": "BTC/USD",
"side": "buy",
"amount": 0.01,
"price": 42000,
"status": "open",
"timestamp": "2024-01-15T10:30:00Z"
}
}
Error Response
{
"success": false,
"error": {
"code": "INSUFFICIENT_BALANCE",
"message": "Insufficient balance to place order",
"details": {
"required": 420.00,
"available": 100.00
}
}
}
Code | Message | Description |
---|---|---|
400 | Bad Request | Invalid request parameters |
401 | Unauthorized | Invalid or missing API credentials |
403 | Forbidden | Insufficient permissions |
429 | Too Many Requests | Rate limit exceeded |
500 | Internal Server Error | Server-side error |
Official SDKs
Testing Tools
Our developer support team is here to help you integrate with our API successfully.
Response times for API support:
- General API questions: Within 24 hours
- Integration issues: Within 4-8 hours
- Critical API issues: Within 1 hour