API Reference

Base URL: https://api.cryptodataapi.dev

Authentication

Pass your API key in the X-API-Key header with every request.

curl https://api.cryptodataapi.dev/v1/trades \
  -H "X-API-Key: YOUR_API_KEY" \
  -G -d "exchange=binance&symbol=BTCUSDT&..."

Rate limits

PlanRequests / minuteHistory window
Free107 days
Pro12090 days
Enterprise1,0002 years

Rate limit headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset

Error codes

CodeMeaning
401Missing or invalid API key
403Plan does not include this endpoint or time range
422Invalid query parameters
429Rate limit exceeded — wait for X-RateLimit-Reset
500Internal server error
GET/healthAll plans

Returns API health, active Redis streams, and disk usage.

Request

curl https://api.cryptodataapi.dev/health

Response

{
  "status": "ok",
  "streams": {
    "binance:trades:BTCUSDT": 147823,
    "bybit:trades:BTCUSDT":  148201,
    "okx:trades:BTCUSDT":    152340
  },
  "data_dir_gb": 12.4
}
GET/v1/symbolsAll plans

List all available exchange/symbol combinations with available data types.

Request

curl https://api.cryptodataapi.dev/v1/symbols \
  -H "X-API-Key: YOUR_KEY"

Response

[
  {
    "exchange": "binance",
    "symbol": "BTCUSDT",
    "data_types": ["trades", "books", "funding"],
    "earliest": "2026-03-18",
    "latest": "2026-03-17"
  },
  ...
]
GET/v1/tradesAll plans

Query historical trade ticks. Supports pagination via cursor.

Parameters
exchangestringrequiredbinance | bybit | okx
symbolstringrequirede.g. BTCUSDT
startISO8601requiredStart of time range (UTC)
endISO8601requiredEnd of time range (UTC)
formatstringoptionaljson | csv | parquet (Pro+)
limitintoptionalMax rows (default 10000, max 100000)
cursorintoptionalPagination cursor (timestamp_ns)

Request

curl "https://api.cryptodataapi.dev/v1/trades?exchange=binance&symbol=BTCUSDT&start=2026-03-17T00:00:00Z&end=2026-03-17T01:00:00Z&limit=3" \
  -H "X-API-Key: YOUR_KEY"

Response

{
  "data": [
    {
      "timestamp_ns": 1742169600000123456,
      "price": 83142.5,
      "qty": 0.003,
      "side": "buy",
      "trade_id": "3891234567"
    }
  ],
  "next_cursor": 1742169600000123456,
  "count": 3
}
GET/v1/booksAll plans

Query L2 order book snapshots. Each row is a full book state.

Parameters
exchangestringrequiredbinance | bybit | okx
symbolstringrequirede.g. BTCUSDT
startISO8601requiredStart of time range (UTC)
endISO8601requiredEnd of time range (UTC)
levelsintoptionalDepth levels to return (default 10, max 50)
formatstringoptionaljson | csv | parquet (Pro+)
limitintoptionalMax rows (default 1000)

Request

curl "https://api.cryptodataapi.dev/v1/books?exchange=binance&symbol=BTCUSDT&start=2026-03-17T00:00:00Z&end=2026-03-17T00:01:00Z&levels=5" \
  -H "X-API-Key: YOUR_KEY"

Response

{
  "data": [
    {
      "timestamp_ns": 1742169600012000000,
      "bids": [[83142.5, 1.23], [83141.0, 0.45], ...],
      "asks": [[83143.0, 0.89], [83144.5, 2.10], ...],
      "spread": 0.5,
      "midprice": 83142.75
    }
  ],
  "count": 60
}
GET/v1/fundingAll plans

Query perpetual funding rate snapshots (updated every second).

Parameters
exchangestringrequiredbinance | bybit | okx
symbolstringrequirede.g. BTCUSDT
startISO8601requiredStart of time range (UTC)
endISO8601requiredEnd of time range (UTC)
formatstringoptionaljson | csv | parquet (Pro+)

Request

curl "https://api.cryptodataapi.dev/v1/funding?exchange=binance&symbol=BTCUSDT&start=2026-03-17T00:00:00Z&end=2026-03-17T08:00:00Z" \
  -H "X-API-Key: YOUR_KEY"

Response

{
  "data": [
    {
      "timestamp_ns": 1742169600000000000,
      "funding_rate": 0.0001234,
      "mark_price": 83142.5,
      "next_funding_time": 1742198400000
    }
  ],
  "count": 28800
}
GET/v1/metrics/obiPro+

Order Book Imbalance — (bid_vol - ask_vol) / (bid_vol + ask_vol). Ranges from -1 to 1.

Parameters
exchangestringrequiredbinance | bybit | okx
symbolstringrequirede.g. BTCUSDT
startISO8601requiredStart of time range (UTC)
endISO8601requiredEnd of time range (UTC)

Request

curl "https://api.cryptodataapi.dev/v1/metrics/obi?exchange=binance&symbol=BTCUSDT&start=2026-03-17T00:00:00Z&end=2026-03-17T00:01:00Z" \
  -H "X-API-Key: YOUR_KEY"

Response

{
  "data": [
    {
      "timestamp_ns": 1742169600012000000,
      "obi": 0.142,
      "top5_obi": 0.218
    }
  ]
}