Skip to main content

Market Data API Overview

Real-time and historical market data: ticker prices, candlestick klines, order book depth, trades, and instrument metadata.

REST endpoints are best for one-shot queries and historical data. WebSocket streams are best for low-latency continuous updates.

Use caseRecommended
Latest price snapshotREST ticker
Continuous price updatesWebSocket ticker
Historical candlesREST klines
Live candlesWebSocket klines
Order book snapshotREST depth
Live order bookWebSocket depth
Recent tradesREST trades
Symbol metadataREST exchange-info

Authentication

All market-data endpoints are publicly accessible without an API key. Signing a request as described in Authentication is optional and increases the per-key rate-limit quota.

Timestamps

The market-data module uses Unix milliseconds (integer) for every timestamp field — open_time, close_time, time, serverTime, ts, etc. This matches Binance spot/futures conventions for OHLCV data and differs from the strategies module, which uses ISO 8601 strings.

Symbol naming

Symbols are uppercase concatenations of the base and quote asset, with no separator: BTCUSDT, ETHUSDT, SOLUSDC. Lowercase symbols are not accepted and will return INVALID_PARAMETER.

Intervals

The interval parameter accepts the following values:

GroupValues
Minutes1m, 3m, 5m, 15m, 30m
Hours1h, 2h, 4h, 6h, 8h, 12h
Days1d, 3d
Weeks1w
Months1M

Note that 1M (month) is uppercase to disambiguate from 1m (minute).

Best practices

  • Use WebSocket streams for live data and trading signals. Subscribe once and consume the push stream.
  • Use REST endpoints for historical backfills, one-off snapshots, and data that does not need to be live.
  • Never poll a REST endpoint at sub-second intervals. A polling cadence below 1 second will trigger rate limiting and is operationally fragile — switch to WebSocket instead.
  • Combine a REST depth snapshot with the market.depth stream to bootstrap a local order book.
  • Treat all decimal values (price, qty, volume, ...) as strings; do not parse to float without a decimal library if precision matters for accounting.