> ## 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 Historical Data API: Routes & Reference

> Hyperliquid historical data API reference: order books and trades from April 2023, funding and OI from May 2023, candles, liquidations, and L4 routes.

Run Hyperliquid core perp history for research, backtesting, replay prep, dashboards, alerts, exports, or generated clients. Order books and trades go back to April 2023, funding and open interest to May 2023, and liquidations to December 2025, continuous to the current hour across REST history, WebSocket replay, and Parquet export.

Use Hyperliquid core routes for standard perp market history. Use [Hyperliquid Spot Data API](/hyperliquid-spot-data-api) for pair symbols such as `HYPE-USDC`, [HIP-3 Data API](/hyperliquid-hip3-data-api) for namespaced builder markets, and [HIP-4 Data API](/hyperliquid-hip4-data-api) for outcome markets. For fill-level trade rows with wallet attribution, start with the [Hyperliquid Fills Data API](/hyperliquid-fills-data-api).

<CardGroup cols={2}>
  <Card title="Hyperliquid REST" icon="chart-candlestick" href="/rest-api/hyperliquid">
    Core perp route family.
  </Card>

  <Card title="Historical guide" icon="database" href="/guides/historical-market-data">
    Bounded pull pattern with freshness checks.
  </Card>
</CardGroup>

## Historical Data In One Path

Hyperliquid historical work needs more than the latest quote. 0xArchive gives teams REST history, generated OpenAPI reference pages, WebSocket replay guidance, reconstruction docs, and data-quality checks in one path.

Use 0xArchive when the same symbol and window must be rerun, compared, exported, replayed, or used by downstream code. If the job is official venue behavior, account state, or execution-adjacent control, keep the native Hyperliquid API in the loop.

## What History Is Available

| Route family              | Earliest      | Detail                                                                         |
| ------------------------- | ------------- | ------------------------------------------------------------------------------ |
| Order books (L2)          | April 2023    | 20-level depth snapshots about every 1.2 seconds; more than 24 billion records |
| Trades                    | April 2023    | Per-trade records; more than 2 billion records                                 |
| Order-level (L4)          | March 2026    | Every resting order with its `oid` and `user_address`, plus reconstruction     |
| Funding and open interest | May 2023      | Per-interval history to the current hour                                       |
| Liquidations              | December 2025 | [Liquidation events by symbol](/hyperliquid-liquidations-data-api)             |

Spot, [HIP-3](/hyperliquid-hip3-data-api), and [HIP-4](/hyperliquid-hip4-data-api) markets carry their own start dates and routes. [Lighter](/lighter-api-quickstart) is a separate venue with its own history window. Hold one symbol and one UTC window constant on the first pull, then widen.

## Run One Route

Start with one bounded order-book or trade request before widening the window.

```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"
```

For timestamped order-book snapshots, use Unix milliseconds for `timestamp`. For historical trade windows, use Unix milliseconds for `start` and `end`.

## Core Perp Route Map

| Need                         | Route family to inspect first                                                                                       |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| Current or timestamped depth | `/v1/hyperliquid/orderbook/{symbol}`                                                                                |
| Historical depth snapshots   | `/v1/hyperliquid/orderbook/{symbol}/history`                                                                        |
| Trades                       | `/v1/hyperliquid/trades/{symbol}`                                                                                   |
| Funding and open interest    | `/v1/hyperliquid/funding/{symbol}`, `/v1/hyperliquid/openinterest/{symbol}`                                         |
| Candles                      | `/v1/hyperliquid/candles/{symbol}`                                                                                  |
| Liquidations                 | `/v1/hyperliquid/liquidations/{symbol}`                                                                             |
| Order-level work             | `/v1/hyperliquid/orderbook/{symbol}/l4/history`, `/v1/hyperliquid/orders/{symbol}/history`, `/orders/{symbol}/flow` |

## Historical Workflow

<Steps>
  <Step title="Pick the core perp symbol">
    Start with a standard symbol such as `BTC` or `ETH`. Do not use this route family for Spot pairs, HIP-3 prefixes, or HIP-4 outcome identifiers.
  </Step>

  <Step title="Pull a bounded window">
    Hold one symbol, route, and UTC window constant while you inspect pagination, returned span, and request IDs.
  </Step>

  <Step title="Add only the needed families">
    Add candles, funding, open interest, liquidations, L4, replay, or exports only when the downstream job requires them.
  </Step>

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

## Selection Checklist

Before comparing 0xArchive to a native venue pull, hold one symbol, one window, and one downstream job constant. Record the route, parameters, returned span, cursor chain, request IDs, data-quality result, and any gap or incident notes. That checklist makes the second run easier to compare than a screenshot or row count.

Ask whether the workflow needs point snapshots, historical records, replay order, or local reconstruction. REST history is best for bounded data pulls. WebSocket replay is best when event order matters. SDK reconstruction is best when the product maintains a local book. All three should preserve request IDs and data-quality context.

## Next Step

Open [Hyperliquid REST](/rest-api/hyperliquid) for the contract layer, then run [Pull historical market data](/guides/historical-market-data) for one symbol and one window before widening the job.
