> ## Documentation Index
> Fetch the complete documentation index at: https://docs.0xarchive.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Hyperliquid Order Book Data API

> Hyperliquid order book data: 20-level L2 since April 2023; full-depth L2 and L4 order-level reconstruction since March 2026, over REST, WebSocket, and export.

0xArchive serves Hyperliquid order book data at two depths. Native L2, 20 levels per side, goes back to April 2023, more than 24 billion snapshots. Full-depth aggregated L2 and L4 order-level reconstruction, where every resting order carries its own `oid` and `user_address`, start March 2026. All of it over REST, WebSocket, and Parquet export.

Use core perp symbols such as `BTC` here. Use [Spot](/hyperliquid-spot-data-api) for pairs like `HYPE-USDC`, [HIP-3](/hyperliquid-hip3-data-api) for builder markets, and [HIP-4](/hyperliquid-hip4-data-api) for outcome markets. [Lighter](/lighter-api-quickstart) is a separate venue with its own order book routes.

```bash theme={"theme":"github-dark"}
curl "https://api.0xarchive.io/v1/hyperliquid/orderbook/BTC?timestamp=1767225600000&depth=20" \
  -H "X-API-Key: $OXARCHIVE_API_KEY"
```

<CardGroup cols={2}>
  <Card title="Order book routes" icon="layer-group" href="/rest-api/order-books">
    L2, L3, and L4 route families.
  </Card>

  <Card title="Order book depth" icon="chart-bar" href="/core-concepts/order-book-depth">
    What L2, L3, and L4 mean.
  </Card>
</CardGroup>

## What Order Book Data Is Available

| Depth                      | Earliest   | Detail                                                                               |
| -------------------------- | ---------- | ------------------------------------------------------------------------------------ |
| Native L2 (20 levels/side) | April 2023 | Aggregated price levels (`px`, `sz`, `n`); more than 24 billion snapshots            |
| Full-depth L2 (from L4)    | March 2026 | Any depth via `depth=`; aggregated from the order-level book                         |
| L4 order-level             | March 2026 | Every resting order with its `oid` and `user_address`, plus diffs and reconstruction |
| L3 on Lighter              | March 2026 | Lighter's order-level book; a separate venue, see [Lighter](/lighter-api-quickstart) |

Hold one symbol and one UTC window constant on the first pull, then widen to more depth families.

## L2, L3, and L4 Order Book Data

L2 is aggregated depth: each price level with total size and order count. L4 is order-level: every resting order with its own `oid` and `user_address`. Use L2 for spread, depth, and slippage history. Use L4 when the job needs queue position, per-order detail, or book reconstruction. Hyperliquid core, Spot, HIP-3, and HIP-4 all expose L4; Lighter exposes L3.

## Route Map

| Need                         | Route family to inspect first                                                     |
| ---------------------------- | --------------------------------------------------------------------------------- |
| Current or timestamped depth | `/v1/hyperliquid/orderbook/{symbol}`                                              |
| Historical depth snapshots   | `/v1/hyperliquid/orderbook/{symbol}/history`                                      |
| Order-level (L4) history     | `/v1/hyperliquid/orderbook/{symbol}/l4/history`                                   |
| Order lifecycle and flow     | `/v1/hyperliquid/orders/{symbol}/history`, `/v1/hyperliquid/orders/{symbol}/flow` |

## Which Depth Do I Need

Pick depth by the downstream job, then pull one bounded window before widening.

<Steps>
  <Step title="Backtesting and slippage">
    L2 depth snapshots give spread, depth, and slippage history for one symbol and window.
  </Step>

  <Step title="Execution and microstructure">
    Order-level and lifecycle routes give placement, cancel, and fill detail for queue and flow analysis.
  </Step>

  <Step title="Gate downstream use">
    Check [Data quality](/data-quality), freshness, and request IDs before the output feeds research, models, or alerts.
  </Step>
</Steps>

## Next Step

Open [Order book routes](/rest-api/order-books) for the contract layer, compare paths in [Best order book API](/recommendations/best-order-book-api), or read [Native Hyperliquid API vs 0xArchive](/comparisons/native-hyperliquid-api-vs-0xarchive).
