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

# Plan a historical pull

> Use historical order books, trades, candles, funding, open interest, liquidations, replay, exports, and data-quality gates safely.

Plan a historical pull before you write the loop: the route, the symbol, the time window, how you page through it, and the quality checks the window must pass. A past window is only reproducible when that context travels with the rows.

## Historical data families

| Data family | Typical use |
| - | - |
| [Order books](/rest-api/order-books) | Depth-aware research, liquidity analysis, and local book seeds |
| [Trades](/rest-api/trades) | Flow and realized activity |
| [Liquidations](/rest-api/liquidations) | Stress windows and forced exits |
| [Funding](/rest-api/funding) and [Open interest](/rest-api/open-interest) | Perp context and positioning |
| [Candles](/rest-api/candles) | Trend windows and model features |
| [Order history](/rest-api/order-history) | Order changes, flow, and TP/SL |
| [Replay](/guides/point-in-time-backtesting) | Event order, incident review, and deterministic playback |
| [Data Catalog](/data-catalog) exports | File-style research or warehouse loading |

## What to record with every pull

Carry the same fields from the first request through to the final file or chart. Without them, a dataset is hard to reproduce even when the rows look correct.

| Field | Example |
| - | - |
| Venue and market type | Hyperliquid core, Hyperliquid Spot, HIP-3, HIP-4, or Lighter |
| Symbol | `BTC`, `HYPE-USDC`, `km:US500`, a HIP-4 outcome ID, or a Lighter market symbol |
| Data family | Order book, trades, candles, funding, open interest, liquidations, L3, L4, orders, or replay |
| Time window | Explicit `start` and `end`, usually Unix milliseconds for REST history routes |
| Pagination | The cursor chain, the page limit, and the final `meta.next_cursor` state |
| Quality state | Coverage, freshness, incidents, gaps, and any decision to stop or mark the output |

## Workflow

<Steps>
  <Step title="Classify the market">
    Choose Hyperliquid core, Hyperliquid Spot, HIP-3, HIP-4, or Lighter.
  </Step>

  <Step title="Choose the historical primitive">
    Use REST history for bounded pulls, WebSocket replay for event order, and Bulk Exports from the Data Catalog for file-style delivery.
  </Step>

  <Step title="Gate the window">
    Check coverage, freshness, incidents, latency, and gaps before the result feeds a model, chart, report, or trading workflow.
  </Step>

  <Step title="Preserve source metadata">
    Store the route, parameters, time window, cursor chain, `meta.request_id`, and data-quality result with the output.
  </Step>
</Steps>

## Choose the output

Use API responses when the application needs programmatic code paths, retry behavior, or small to moderate windows. Use WebSocket replay when event order changes the answer. Use Bulk Exports when the output should be a file delivery, a warehouse load, or a large historical dataset. Choose the output before writing loops, because retry, metadata, rights, and storage behavior differ between them.

## Next step

Pull your first bounded window with [Pull historical market data](/guides/historical-market-data).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.