L1 / top of book
Best bid and best ask only. Derive this view after replaying the L2 snapshots and deltas; ticker statistics are not a substitute for quotes.
BitMEX Order Book Dataset
BitMEX derivatives order book snapshots and deltas stored in a normalized schema for systematic research and replay.
No credit card · The sample is one real hourly Parquet file and needs no API key
Is this the right dataset?
This landing page is for coverage, schema, sample files, and downloads. Use the SDK docs for method parameters and the reconstruction tutorial for replay logic.
Best bid and best ask only. Derive this view after replaying the L2 snapshots and deltas; ticker statistics are not a substitute for quotes.
This dataset. It records aggregate quantity at each visible price level so you can measure spread, depth, and imbalance.
Not provided. L2 cannot reveal queue position or how many individual orders make up a level unless the venue publishes an order count.
Sample
The first rows of one real hour: XBTUSDT on BitMEX, 2026-09-02 at 12:00 UTC. One row per bid or ask price level in a snapshot or update.
bitmex/2026-09-02/12/XBTUSDT_orderbook.parquetDownload full file| received_time | event_time | transaction_time | symbol | event_type | first_update_id | final_update_id | prev_final_update_id | last_update_id | side | price | quantity | order_count |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1788350556363458711 | 1788350556363458711 | null | XBTUSDT | snapshot | 234034599815 | 234034599815 | null | 234034599815 | bid | 76754.1 | 6778700 | null |
| 1788350556363458711 | 1788350556363458711 | null | XBTUSDT | snapshot | 233836572779 | 233836572779 | null | 233836572779 | ask | 240430 | 613600 | null |
| 1788350556363458711 | 1788350556363458711 | null | XBTUSDT | snapshot | 234034599842 | 234034599842 | null | 234034599842 | bid | 76745.9 | 1900 | null |
| 1788350400314243121 | 1788350400314243121 | null | XBTUSDT | update | 234034540919 | 234034540919 | null | 234034540919 | bid | 76778.2 | 0 | null |
| 1788350400000098372 | 1788350400000098372 | null | XBTUSDT | update | 234034541129 | 234034541129 | null | 234034541129 | ask | 76866.2 | 0 | null |
| 1788350400314243121 | 1788350400314243121 | null | XBTUSDT | update | 234034540922 | 234034540922 | null | 234034540922 | bid | 76774.8 | 0 | null |
Wire format
Every row starts as a message on the exchange's WebSocket or REST API. Point at a line or a column to see where each value comes from and how we convert it. Our test suite replays these messages through the production pipeline, so the rows shown are the rows you download.
BitMEX (historical)
Reconstructed: BitMEX is closed, and it is not possible to capture its feed now. After each connection or reconnection, BitMEX sends a partial with the full order book. Each level becomes one snapshot row. keys, types and filter are copies from an orderBookL2 partial that BitMEX sent on 2026-10-05.
Exchange sends
WebSocket message (reconstructed) · orderBookL2:<symbol>received 2026-09-02 12:02:36.363458 UTC
{"table": "orderBookL2","action": "partial","keys": ["symbol", "id", "side"],"types": {"symbol": "symbol","id": "long","side": "symbol","size": "long","price": "float","pool": "symbol","timestamp": "timestamp","transactTime": "timestamp"},"filter": {"pool": "Aggregated","symbol": "XBTUSDT"},"data": [{"symbol": "XBTUSDT","id": 234034598936,"side": "Sell","size": 291100,"price": 76824.2},{"symbol": "XBTUSDT","id": 234034600390,"side": "Sell","size": 267100,"price": 76822.4},{"symbol": "XBTUSDT","id": 234034599815,"side": "Buy","size": 6778700,"price": 76754.1},{"symbol": "XBTUSDT","id": 234034599842,"side": "Buy","size": 1900,"price": 76745.9}]}
Shortened: The original partial had 132 levels (99 bids, 33 asks). The example shows the two best asks and the two best bids, in the original order. BitMEX also sent timestamp and transactTime on each level. We do not publish these fields, thus the example does not show them.
You download
Parquet row · orderbook · 1 of 4 rows from this message
Point at a line in the message or a column in the row to trace where each value comes from. Click a column to pin it.
Rebuilt from published rows; the exchange has closed
All BitMEX (historical) mapping rules →Conventions for every exchange are in the wire formats overview. Column types and units for order book data are in the schema below.
Use cases
Coverage
Every venue is stored under its own exchange ID, so spot and derivatives never mix. Bars show each venue's history from its first hourly file to today, or to its last file for a venue that is no longer collected. Symbol counts are live from the symbols API.
| Venue | Exchange ID | Market | History | Order book symbols |
|---|---|---|---|---|
| bitmex | Futures | 2025-09-29 to 2026-09-2212 mo | 156 |
Other exchanges
The same schema on every venue, so switching exchange is a one-argument change.
Or compare every venue on the cross-exchange order book overview.
Schema · 13 columns
Every row represents one bid or ask price level inside a snapshot or incremental update. Rows carry exchange timing, sequence fields when available, price, quantity, and event type.
| Column | Type | Description |
|---|---|---|
| received_time | INT64 | Unix timestamp (nanoseconds) when our system received the event |
| event_time | INT64 | Unix timestamp when the exchange generated the event (the time unit changes with the exchange) |
| transaction_time | INT64nullable | Exchange-specific transaction timestamp (if available) |
| symbol | STRING | Trading pair symbol (for example, "BTCUSDT") |
| event_type | STRING | Type of order book event ("snapshot" or "update") |
| first_update_id | INT64nullable | First update ID in the update sequence |
| final_update_id | INT64nullable | Final update ID in the update sequence |
| prev_final_update_id | INT64nullable | Previous final update ID (to find gaps) |
| last_update_id | INT64nullable | Last update ID that the exchange processed |
| side | STRING | Order book side ("bid" or "ask") |
| price | STRING | Price level (stored as string for precision) |
| quantity | STRING | Quantity at the price level (stored as string for precision). The unit is the base asset on most venues. OKX derivatives use contracts, and BitMEX uses raw instrument units (refer to the venue notes) |
| order_count | INT64nullable | Number of orders at this price level (if the exchange gives it) |
Quickstart
The example loads XBTUSDT from BitMEX for 2026-09-02. Change the symbol, exchange, or dates to pull any other slice of the archive.
pip install cryptohftdataSign up with email or Google, then generate a key from your dashboard. No credit card.
Create accountPaste the snippet, replace YOUR_API_KEY, and you get a pandas DataFrame with the columns listed above.
import cryptohftdata as chd
client = chd.CryptoHFTDataClient(api_key="YOUR_API_KEY")
df = client.get_orderbook(
symbol="XBTUSDT",
exchange=chd.exchanges.BITMEX,
start_date="2026-09-02",
end_date="2026-09-02",
)
print(df.head())
print(f"Order book rows: {len(df):,}")curl --fail --location \
"https://api.cryptohftdata.com/download?file=bitmex/2026-09-02/12/XBTUSDT_orderbook.parquet" \
-o XBTUSDT_orderbook_12.parquetCaveats
Exchange feeds differ in subtle ways. These are the details that matter for accurate backtests, replay pipelines, and features. Missing hours and pending corrections for every venue are listed on Known Gaps & Corrections.
L2 order book data is aggregated by price level, not individual L3 orders.
Files contain snapshots plus incremental updates. Build state from a complete snapshot, apply later events in stored order, and reset whenever another snapshot appears.
Sequence fields vary by venue. If available continuity IDs show a gap, discard the local book and wait for a newer snapshot rather than replaying a state you cannot verify.
Quantities are in the venue's unit: base asset on most venues, contracts on OKX derivatives (multiply by the instrument's ctVal), and raw per-instrument units on BitMEX.
Hour-start checkpoint snapshots exist for Binance, Aster, OKX, Bybit, Bitget, Lighter, Kraken Futures and Hyperliquid, not for Kraken spot or BitMEX. A checkpoint is written only when the book is proven current, so some hours start without one; continue from the previous hour's book or wait for the next snapshot.
This page covers 2025-09-29 to 2026-09-22. The exchange has closed, so no new hourly files are published; the existing files remain downloadable.
FAQ
Yes. A free CryptoHFTData account with no credit card gives API access to BitMEX order book data and every other dataset. Individual hourly files can also be downloaded without an API key on the rate-limited free tier.
The hourly files run from 2025-09-29 to 2026-09-22. The exchange has closed, so no new files are added, but the existing files remain downloadable.
Each file holds one symbol for one UTC hour, stored as Zstd-compressed Parquet under {exchange_id}/{YYYY-MM-DD}/{HH}/{SYMBOL}_orderbook.parquet. Parquet reads directly into pandas, Polars, DuckDB, and Arrow.
Install the SDK with pip install cryptohftdata, create a client with your API key, and call client.get_orderbook() with a symbol, exchange, and date range. It returns a pandas DataFrame.
L2. Each row is the aggregate quantity at one price level, recorded in snapshots and incremental updates. Individual orders (L3) and queue position are not included.
One free API key covers every exchange and every data type. $0.00.