For the complete documentation index, see llms.txt. This page is also available as Markdown.

OKX Spot

OKX Spot historical market data details - currency pairs, data coverage and data collection specifics

OKX historical data for spot high caps currency pairs is available since 2019-03-30, data for all spot currency pairs is available since 2021-03-11.

See OKX Spot historical data coverage: available symbols, channels, date ranges and incidents

Downloadable CSV files

Historical CSV datasets for the first day of each month are available to download without API key. See downloadable CSV files documentation.

data type
symbol
date

incremental_book_L2

BTC-USDT

2020-01-01

trades

BTC-USDT

2020-01-01

quotes

BTC-USDT

2020-01-01

API Access and data format

Historical data format is the same as provided by real-time OKX WebSocket v5 API with addition of local timestamps (before 2021-12-23 it was v3 API version). If you'd like to work with normalized data format instead (same format for each exchange) see downloadable CSV files or official client libs that can perform data normalization client-side.

Tardis-machine is a locally runnable server that exposes API allowing efficiently requesting historical market data for whole time periods in contrast to HTTP API that provides data only in minute by minute slices.

See tardis-machine docs.

Captured real-time channels

See OKX Spot WebSocket API docs providing documentation for each captured channel's format

Click any channel below to see HTTP API response with historical data recorded for it.

Current channels (API v5, since 2021-12-23):

  • trades Public spot trade executions stream

  • trades-all — available since 2023-10-19 All trades stream including non-aggregated trade messages

  • books-l2-tbt — available until 2026-05-21 Tick-by-tick L2 spot order book updates

  • books — available from 2023-02-24 to 2024-07-19, and from 2026-05-21 onward Incremental spot order book depth updates

  • bbo-tbt — available since 2022-05-05 Tick-by-tick best bid and offer updates

  • tickers 24h spot ticker updates

  • interest-rate-loan-quota — generated channel Public interest rate and loan quota snapshots from REST endpoint

  • vip-interest-rate-loan-quota — generated channel VIP interest rate and loan quota snapshots from REST endpoint

  • status Exchange status and maintenance notifications

  • instruments Instrument state updates (listing, suspension, parameter changes)

  • taker-volume — generated channel Taker buy/sell volume snapshots from REST statistics endpoint (1m). From 2023-06-09 15:30 UTC to 2026-08-04 11:16 UTC, updates occurred at varying intervals longer than the documented 1m.

  • liquidations — generated channel Margin liquidation events from REST liquidation orders endpoint

  • public-block-trades — available since 2023-01-01 Public block trades stream

  • public-struc-block-trades — available since 2023-01-01 Public structured block trades stream

  • loan-ratio — generated channel Margin loan ratio snapshots from REST statistics endpoint (1m). From 2023-06-09 15:30 UTC to 2026-08-04 11:16 UTC, updates occurred at varying intervals longer than the documented 1m.

Legacy channels (API v3, until 2021-12-23):

  • spot/trade Public spot trade executions stream

  • spot/depth — available until 2020-04-11 Incremental spot order book updates (legacy depth channel)

  • spot/depth_l2_tbt — available since 2020-04-09 Tick-by-tick L2 spot order book updates with sequencing

  • spot/ticker 24h spot ticker updates

  • system/status — available since 2020-07-01 Exchange status and maintenance notifications

  • margin/interest_rate — available since 2021-02-24 Margin interest rate updates

Market data collection details

Market data collection infrastructure for OKX Spot is located in GCP asia-northeast1 region (Tokyo, Japan) since 2026-05-21. Before that, from 2022-05-04, it was located in AWS HK region (Hong Kong, China, VPC colo setup), before that, since 2020-05-15 it was located in GCP asia-northeast1 region (Tokyo, Japan) and initially it was located in GCP europe-west2 region (London, UK).

Real-time market data is captured via multiple WebSocket connections to wss://ws.okx.com:8443/ws/v5/public. Before 2026-05-21, data was captured from the OKX colocation endpoint at wss://awscolows1.okx.com:8443/ws/v5/public.

OKX servers are located in Alibaba Cloud cn-hongkong region (Hong Kong, China).

Last updated

Was this helpful?