BitMEX Order Book Dataset

BitMEX Historical Order Book Data

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?

Choose the order book detail your research needs

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.

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.

L2 / price-level depth

This dataset. It records aggregate quantity at each visible price level so you can measure spread, depth, and imbalance.

L3 / individual orders

Not provided. L2 cannot reveal queue position or how many individual orders make up a level unless the venue publishes an order count.

Sample

See the data before you sign up

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_timeevent_timetransaction_timesymbolevent_typefirst_update_idfinal_update_idprev_final_update_idlast_update_idsidepricequantityorder_count
17883505563634587111788350556363458711nullXBTUSDTsnapshot234034599815234034599815null234034599815bid76754.16778700null
17883505563634587111788350556363458711nullXBTUSDTsnapshot233836572779233836572779null233836572779ask240430613600null
17883505563634587111788350556363458711nullXBTUSDTsnapshot234034599842234034599842null234034599842bid76745.91900null
17883504003142431211788350400314243121nullXBTUSDTupdate234034540919234034540919null234034540919bid76778.20null
17883504000000983721788350400000098372nullXBTUSDTupdate234034541129234034541129null234034541129ask76866.20null
17883504003142431211788350400314243121nullXBTUSDTupdate234034540922234034540922null234034540922bid76774.80null
Showing 6 of 86,648 rows in this hourTimestamps are raw integers; units are in the schema below

Wire format

From exchange message to Parquet row

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

What you can build with order book data

Spread, depth, and imbalance
Replay the book to measure bid/ask spread, depth within N basis points, and order book imbalance at any moment in the hour.
Execution and market-making backtests
Simulate fills against the liquidity that was actually resting on the book instead of assuming a mid-price fill.
Cross-venue liquidity research
Compare depth and spread across exchanges with one schema instead of maintaining a parser per venue.

Coverage

Order book 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.

Order book coverage by venue, exchange ID, market, history start, and live symbol count
VenueExchange IDMarketHistoryOrder book symbols
BitMEXbitmexFutures
2025-09-29 to 2026-09-2212 mo
156

Other exchanges

Order Book data on 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

Normalized L2 order book schema

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.

Columns in every order book Parquet file
ColumnTypeDescription
received_timeINT64Unix timestamp (nanoseconds) when our system received the event
event_timeINT64Unix timestamp when the exchange generated the event (the time unit changes with the exchange)
transaction_timeINT64nullableExchange-specific transaction timestamp (if available)
symbolSTRINGTrading pair symbol (for example, "BTCUSDT")
event_typeSTRINGType of order book event ("snapshot" or "update")
first_update_idINT64nullableFirst update ID in the update sequence
final_update_idINT64nullableFinal update ID in the update sequence
prev_final_update_idINT64nullablePrevious final update ID (to find gaps)
last_update_idINT64nullableLast update ID that the exchange processed
sideSTRINGOrder book side ("bid" or "ask")
priceSTRINGPrice level (stored as string for precision)
quantitySTRINGQuantity 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_countINT64nullableNumber of orders at this price level (if the exchange gives it)

Quickstart

From pip install to DataFrame in a minute

The example loads XBTUSDT from BitMEX for 2026-09-02. Change the symbol, exchange, or dates to pull any other slice of the archive.

  1. Install the Python SDK

    pip install cryptohftdata
  2. Create a free API key

    Sign up with email or Google, then generate a key from your dashboard. No credit card.

    Create account
  3. Call get_orderbook()

    Paste the snippet, replace YOUR_API_KEY, and you get a pandas DataFrame with the columns listed above.

bitmex_orderbook_data.py
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):,}")
REST · no API key needed for single files
curl --fail --location \
  "https://api.cryptohftdata.com/download?file=bitmex/2026-09-02/12/XBTUSDT_orderbook.parquet" \
  -o XBTUSDT_orderbook_12.parquet

Caveats

Know this before you backtest

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.

  1. L2 order book data is aggregated by price level, not individual L3 orders.

  2. Files contain snapshots plus incremental updates. Build state from a complete snapshot, apply later events in stored order, and reset whenever another snapshot appears.

  3. 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.

  4. 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.

  5. 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.

  6. 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

Frequently asked questions

Is BitMEX order book data free to download?

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.

How far back does BitMEX order book data go?

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.

What format are the files in?

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.

How do I load BitMEX order book data in Python?

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.

Is this L2 or L3 order book data?

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.

Start using order book data today.

One free API key covers every exchange and every data type. $0.00.