Where Do I Get Hyperliquid Historical Order Book Data?

Anyone building a fill model or a slippage-aware backtest on Hyperliquid eventually types hyperliquid historical order book data into a search box and finds three answers. The public l2Book info request returns only the current book. Hyperliquid's own historical archive is an AWS requester-pays bucket of hourly LZ4 files per coin, uploaded with a lag, which you must download and parse yourself. And the paid market-data vendors sell normalised feeds at vendor prices.

We add a fourth: a 5-minute snapshot archive of the top-20 L2 ladder for every active Hyperliquid perp with at least $100k of 24-hour notional, about 150 coins, served as JSON from GET /api/v1/backtesting/snapshots?data_type=hl_l2_books (Pro Plus), plus a banded-depth series and the live book on the free tier. This post states the coverage, the record shape, the two clocks, and the limits, so you can decide in a minute whether it fits.

What One hl_l2_books Record Holds

Each 5-minute snapshot is an array of per-coin records. The ladder is Hyperliquid's public l2Book, which is at most 20 price levels per side; that cap is Hyperliquid's, not ours, and it is the same on the live call.

FieldMeaning
coinHyperliquid's own name (e.g. kPEPE)
bids / asksUp to 20 levels each, nearest first, as {price, size, count}; count is resting orders at that price
best_bid / best_askTop of book
bid_depth_usd / ask_depth_usdSum of price x size over the stored levels. A top-20 sum, not a fixed price band.
spread_pct(ask - bid) / bid x 100
tsHyperliquid's own snapshot time for this book (ms)
captured_atOur receive time (ms); null on archive-backfilled rows
sourcelive, or hl_s3_archive for rows backfilled from Hyperliquid's public archive

ts, captured_at and source were added on 2026-10-23 and are null on records written before that date. The snapshot key time is unchanged: it is the 5-minute bucket the sweep started in, and a book can arrive minutes later behind the request queue. That is why ts exists: never assume a book sits on its bucket boundary.

Pulling a Day of Ladders

The endpoint streams row by row, so even limit=1000 is safe. start is required, end is exclusive, both accept ISO 8601 or unix ms.

curl "https://cryptodataapi.com/api/v1/backtesting/snapshots?data_type=hl_l2_books&start=2026-10-20T00:00:00Z&end=2026-10-21T00:00:00Z&limit=300" \
  -H "X-API-Key: cdk_live_your_key" --compressed

Response shape (one coin shown, values illustrative):

{
  "data_type": "hl_l2_books",
  "count": 288,
  "snapshots": [
    {
      "time": 1792800000000,
      "data": [
        {
          "coin": "BTC",
          "best_bid": 71240.0, "best_ask": 71241.0,
          "bid_depth_usd": 2410500.12, "ask_depth_usd": 2188420.55,
          "spread_pct": 0.001404,
          "bids": [{"price": 71240.0, "size": 3.21, "count": 7}, "...19 more"],
          "asks": [{"price": 71241.0, "size": 2.87, "count": 5}, "...19 more"],
          "ts": 1792800003412,
          "captured_at": 1792800003650,
          "source": "live"
        }
      ]
    }
  ]
}

A full day is 288 snapshots of ~150 coins. For multi-day pulls use the pre-built daily files instead of paginating: GET /api/v1/backtesting/archives/download?data_type=snapshots&symbol=hl_l2_books&start=2026-10-01&end=2026-10-07 returns pre-signed links. The same file is buyable without a key for USDC over x402 at /backtesting/archives/purchase?data_type=snapshots&snapshot_type=hl_l2_books&date=YYYY-MM-DD, $0.25 per day-file.

Coverage: the snapshot endpoint's local store starts 2026-05-09 (checked 2026-10-24; /backtesting/snapshots/types reports the live range), and the daily archive files reach back to March 2026 via rows backfilled from Hyperliquid's archive. The universe was the top 20 perps before 2026-06-14 and the volume-floored ~150 since.

Banded Depth: liquidity_depth and /liquidity/depth/{coin}

A raw ladder is the right input for a fill simulator. For a feature, you usually want USD depth within a fixed distance of mid, and that is a different series: liquidity_depth.

It covers the top 25 Hyperliquid perps by 24h notional, sampled about every 2 minutes, and each record carries mid_price, spread_bps, depth_usd.bid / .ask at 10bps, 25bps, 50bps and 100bps, bid_levels / ask_levels, total_depth_25bps_usd, imbalance_10bps and the joined open_interest_usd. Since 2026-10-23 it also carries ts_ms and book_ts; the older ts is seconds on live rows and milliseconds on backfilled rows, so read ts_ms.

The honesty flag is levels_truncated: per side and per band, true means the 20-level book ran out inside that band, so the depth figure is a lower bound, not the resting liquidity. On a thin alt the 100 bps band is truncated most of the time. That is the 20-level cap showing through, and it is why we never present a wide band as complete.

Live and rolling: GET /api/v1/liquidity/depth/{coin}?minutes=1440 returns up to 24h of the same records, oldest first, BTC on the free tier and the full tracked 25 on Pro. Archived: data_type=liquidity_depth on /backtesting/snapshots, locally from 2026-05-30.

curl "https://cryptodataapi.com/api/v1/liquidity/depth/BTC?minutes=240" \
  -H "X-API-Key: cdk_live_your_key"

The Live Book and the Clock Behind It

GET /api/v1/hyperliquid/l2-book?coin=ETH returns the current ladder as bids / asks of {price, size, count} plus ts, Hyperliquid's own timestamp for the snapshot, and received_at, so you can measure how far behind the exchange the served book is. symbol is accepted as an alias; any other unknown query parameter is a 400, so a typo cannot silently return the default coin's book.

Aligning the three series is simple once you know which clock each carries:

SeriesExchange timeOur timeCadenceUniverse
hl_l2_bookstscaptured_at5 min~150 perps (volume floor)
liquidity_depthbook_tsts_ms~2 minTop 25
/hyperliquid/l2-booktsreceived_atLiveAny listed coin

Join on the exchange clock when you are matching books to fills or candles; use our clock only to audit latency. A minimal walk of one day's ladders into a per-coin spread and depth table looks like this:

import httpx, statistics as st
BASE = "https://cryptodataapi.com/api/v1"
H = {"X-API-Key": "cdk_live_your_key"}

r = httpx.get(f"{BASE}/backtesting/snapshots", headers=H, timeout=120, params={
    "data_type": "hl_l2_books", "start": "2026-10-20T00:00:00Z",
    "end": "2026-10-21T00:00:00Z", "limit": 300}).json()

by_coin = {}
for snap in r["snapshots"]:
    for b in snap["data"]:
        if b["spread_pct"] is None:
            continue
        d = by_coin.setdefault(b["coin"], {"spread": [], "depth": [], "lag_ms": []})
        d["spread"].append(b["spread_pct"])
        d["depth"].append(b["bid_depth_usd"] + b["ask_depth_usd"])
        if b.get("ts") and b.get("captured_at"):
            d["lag_ms"].append(b["captured_at"] - b["ts"])

for coin, d in sorted(by_coin.items(), key=lambda kv: -st.median(kv[1]["depth"]))[:10]:
    print(coin, round(st.median(d["spread"]), 5), round(st.median(d["depth"])),
          round(st.median(d["lag_ms"])) if d["lag_ms"] else None)

The last column is the receive lag per book, which is only measurable because both clocks are stored. A median of a few hundred milliseconds is normal; a book that arrives a minute after its bucket is the request queue, not the exchange.

This Archive vs Hyperliquid's S3 Bucket vs Paid Vendors

What none of them can give you is more than 20 levels from the public book, or a book from before Hyperliquid started publishing one. Those limits are the venue's.

When to Use This (and When Not To)

Use it for a slippage model that walks a real top-20 ladder at 5-minute resolution, depth-at-bps features joined to candles on ts, spread regimes per coin, and auditing how thin a book was at a liquidation you are studying in the fill tape.

Background reading: the live endpoint's fields in Hyperliquid L2 order book API, the slippage case in Order-Book Depth & Liquidity API, and buying single archive files in x402 archive purchase.

Frequently asked questions

Does the API have historical Hyperliquid order book data?

Yes. GET /api/v1/backtesting/snapshots?data_type=hl_l2_books serves 5-minute snapshots of the top-20 bid and ask ladder for about 150 active Hyperliquid perps (Pro Plus). Daily files are also on /backtesting/archives/download and buyable per day over x402.

How many levels does each order book snapshot hold?

Up to 20 price levels per side, which is the cap of Hyperliquid's public l2Book. bid_depth_usd and ask_depth_usd are sums over those levels, not a fixed price band; the liquidity_depth series provides bps-banded depth with a levels_truncated flag.

What are ts and captured_at on an hl_l2_books record?

ts is Hyperliquid's own snapshot time for the book in ms; captured_at is our receive time. Both were added 2026-10-23 and are null on older records. The snapshot key time is the 5-minute bucket the sweep started in.

How far back do the Hyperliquid order book snapshots go?

The snapshot endpoint's store starts 2026-05-09 as of 2026-10-24, and the daily archive files reach back to March 2026 using rows backfilled from Hyperliquid's public archive (source = hl_s3_archive). Before 2026-06-14 the universe was the top 20 perps.