API Documentation

Integrate with CryptoCoEX using our REST API. Access market data, manage orders, and build custom trading applications.

Quick Start

Base URL

https://api.cryptoexchange.com

API Version

Current version: v1

Response Format

All responses are returned in JSON format.

Authentication

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.

Rate Limits

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 Endpoints
GET/api/markets

Get market data for all cryptocurrencies

Rate limit: 100 requests/minute

GET/api/prices

Get current prices for all supported cryptocurrencies

Rate limit: 100 requests/minute

GET/api/portfolio/balances
Auth Required

Get user portfolio balances

Rate limit: 60 requests/minute

POST/api/orders
Auth Required

Place a new trading order

Rate limit: 30 requests/minute

GET/api/orders
Auth Required

Get order history

Rate limit: 60 requests/minute

DELETE/api/orders/:id
Auth Required

Cancel an open order

Rate limit: 30 requests/minute

Code Examples

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
  }'
Response Examples

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
    }
  }
}
Common Error Codes
CodeMessageDescription
400Bad RequestInvalid request parameters
401UnauthorizedInvalid or missing API credentials
403ForbiddenInsufficient permissions
429Too Many RequestsRate limit exceeded
500Internal Server ErrorServer-side error
Need Help?

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