OKX Trade Dataset

OKX Historical Trade Data

OKX trade prints from spot and futures markets, normalized into the same tick schema used across CryptoHFTData venues.

Coverage

Trade data coverage

Coverage is organized by exchange, market type, and hourly object path. Live symbol counts are shown when the symbols API responds during page generation.

VenueExchange IDMarketHistory startTrade symbols
OKX Futuresokx_futuresFutures2025-06-28476
OKX Spotokx_spotSpot2025-06-281,374

Schema

Normalized trade schema

Every trade row is a tick-level execution with exchange timing, trade ID, price, quantity, maker/taker direction, and order type.

FieldTypeNullableDescription
received_timeINT64NoUnix timestamp (nanoseconds) when our system received the trade event
event_timeINT64NoUnix timestamp (exchange dependent on timescale) when the exchange generated the event
symbolSTRINGNoTrading pair symbol (e.g., 'BTCUSDT')
trade_idINT64NoExchange-specific unique trade identifier
priceSTRINGNoTrade execution price (stored as string for precision)
quantitySTRINGNoTrade quantity/volume (stored as string for precision)
trade_timeINT64NoUnix timestamp (exchange dependent on timescale) when the trade occurred
is_buyer_makerBOOLEANNoTrue if buyer was the maker (passive side), false if taker
order_typeSTRINGNoType of order that generated this trade (e.g., "LIMIT", "MARKET")

Access

Download with Python or REST

The sample below downloads BTC-USDT-SWAP from OKX Futures for 2025-08-01, hour 20.

Python SDK
import cryptohftdata as chd

client = chd.CryptoHFTDataClient(api_key="your-api-key-here")

df = client.get_trades(
    symbol="BTC-USDT-SWAP",
    exchange=chd.exchanges.OKX_FUTURES,
    start_date="2025-08-01",
    end_date="2025-08-01",
)

print(df.head())
print(f"Trades: {len(df):,}")
REST API
curl "https://api.cryptohftdata.com/download?file=okx_futures/2025-08-01/20/BTC-USDT-SWAP_trades.parquet.zst&api_key=your-api-key-here" \
  -o BTC-USDT-SWAP_trades_20.parquet.zst

Caveats

What this data is and is not

These details are important for accurate backtests, replay pipelines, and microstructure features.

Each row is a public trade print as published by the exchange; trade ID semantics and aggregation behavior vary by venue.

Prices and quantities are stored as strings to preserve exchange precision; cast to decimals or floats as needed.

This page starts on 2025-06-28 based on the earliest stored hourly files for its covered exchange IDs and grows as new hourly files are published.

Next

Use the trade data

Start with an API key, then move between docs, tutorials, and the browser data explorer as needed.