REST API

Order Book Data

Order book data contains L2 depth information. It shows the bid and ask levels with their prices and quantities. Each file contains one hour of order book snapshots and updates.

Download Order Book Data

Download the hourly order book data files for the trading pairs and exchanges that you select.

GET/download

Request Parameters

ParameterTypeRequiredDescription
filestringYesFile path in this pattern: {exchange}/{date}/{hour}/{symbol}_orderbook.parquet
api_keystringNoOptional. Do not send it if you use the free tier (60 requests/minute). Send an API key if you do not use JWT authentication.

Example: Download BTCUSDT Order Book

Terminal
curl "https://api.cryptohftdata.com/v1/download?file=binance_spot/2025-08-01/20/BTCUSDT_orderbook.parquet&api_key=your-api-key-here" \
  -o BTCUSDT_orderbook_20.parquet

Venue-specific semantics

  • Kraken Spot: The Kraken spot order book feed keeps a window of 1,000 levels on each side. It does not delete levels that move out of the window. From the 2026-09 data-integrity release, we publish these levels as delete rows. Thus, a plain replay stays within 1,000 levels on each side. For earlier files, keep only the best 1,000 levels on each side after each update.
  • Hour-start snapshots: Binance (spot and futures), Aster, OKX, Bybit, Bitget, Lighter, Kraken Futures and Hyperliquid files can start with a checkpoint snapshot of the order book at the hour boundary. Kraken spot and BitMEX files do not. We write a checkpoint only when we can prove that the order book is current. Thus, some hours start without one. In that case, continue from the order book of the previous hour, or wait for the next snapshot in the file.
  • Binance, Aster: From 2026-09-30, collectors that we started or restarted with the updated version publish each accepted REST depth snapshot one time. Older files can contain identical consecutive copies of the same snapshot (on Binance, one copy can have received_time = event_time × 1e6). These identical copies do not change the reconstructed order book. We do not plan an archive-wide cleanup, because the impact is low. Replay the files in their published message order with the native sequence IDs, and do not sort only by event_time. Duplicate copies can change snapshot counts and the analysis of receipt times.
  • Lighter: From the 2026-09 data-integrity release, final_update_id is the Lighter nonce, and prev_final_update_id is the Lighter begin_nonce. The prev_final_update_id of each update is equal to the final_update_id of the previous update. A snapshot starts a new chain. Thus, a mismatch is a gap. last_update_id contains the offset of the API server, which puts messages in order but is not contiguous. In earlier files, final_update_id and last_update_id both contain the offset, and prev_final_update_id is empty. The offset starts again when a reconnect goes to a different Lighter server. Thus, a lower value after a reconnect is normal, and you cannot find gaps. Treat a crossed order book as not valid, and continue from the next snapshot.
  • OKX perpetual swaps: Sizes are in contracts. Multiply each size by the contract value of the instrument (ctVal from the OKX instruments endpoint, in ctValCcy units). This unit is the base coin for linear swaps, for example BTC-USDT-SWAP. It is USD for inverse swaps, for example BTC-USD-SWAP. OKX spot sizes are already in the base coin.
  • BitMEX: Quantities are in raw units that are different for each instrument: XBTUSD in USD contracts, XBTUSDT in 1e-6 BTC, ETHUSDT in 1e-5 ETH, and spot pairs in 1e-8 of the base asset. Before you compare with other venues, check the multiplier of the instrument.

For missing hours, partial periods and pending corrections to published history, refer to Known Gaps & Corrections.

If you cannot find the information that you need, tell us. We also help with integrations.

Contact support