> ## 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 Spot REST API

> Use Hyperliquid Spot REST for pairs, L2 books, trades, candles, L4 resting-book checkpoints and ordered diffs, separate order history, TWAP, and freshness.

Pull Hyperliquid Spot pairs, order books, trades, candles, L4 depth, order history, and TWAP under `/v1/hyperliquid/spot/*`. Spot routes take pair symbols such as `HYPE-USDC`; perp symbols such as `BTC` belong to the core namespace.

## Routes

| Route | Returns |
| - | - |
| `/v1/hyperliquid/spot/pairs` | Every Spot pair |
| `/v1/hyperliquid/spot/pairs/{symbol}` | One pair's metadata |
| `/v1/hyperliquid/spot/orderbook/{symbol}` | Current L2 depth |
| `/v1/hyperliquid/spot/orderbook/{symbol}/history` | Historical L2 snapshots |
| `/v1/hyperliquid/spot/trades/{symbol}` | Historical trades for a bounded window |
| `/v1/hyperliquid/spot/candles/{symbol}` | OHLCV candles |
| `/v1/hyperliquid/spot/orderbook/{symbol}/l4` | An L4 checkpoint to start reconstruction from |
| `/v1/hyperliquid/spot/orderbook/{symbol}/l4/diffs` | Ordered L4 book diffs |
| `/v1/hyperliquid/spot/orderbook/{symbol}/l4/history` | Historical resting-book reconstruction windows |
| `/v1/hyperliquid/spot/orders/{symbol}/history` | Order-lifecycle records |
| `/v1/hyperliquid/spot/twap/{symbol}` | TWAP orders for one pair |
| `/v1/hyperliquid/spot/twap/user/{user}` | TWAP orders for one user |
| `/v1/hyperliquid/spot/freshness/{symbol}` | Latest stored time for each data type |

The L4 routes serve L4 resting-book checkpoints and ordered diffs. Order history returns separate historical order-lifecycle records, not L4 book state. Exact parameters are in the [Spot endpoint reference](/api-reference/hyperliquid-spot).

## Example

<CodeGroup>
  ```bash curl theme={"theme":"github-dark"}
  curl "https://api.0xarchive.io/v1/hyperliquid/spot/orderbook/HYPE-USDC?depth=10" \
    -H "X-API-Key: $OXARCHIVE_API_KEY"
  ```

  ```python Python theme={"theme":"github-dark"}
  import os
  import requests

  resp = requests.get(
      "https://api.0xarchive.io/v1/hyperliquid/spot/trades/HYPE-USDC",
      headers={"X-API-Key": os.environ["OXARCHIVE_API_KEY"]},
      params={"limit": 50},
      timeout=30,
  )
  resp.raise_for_status()
  payload = resp.json()
  print(payload["meta"]["request_id"])
  ```
</CodeGroup>

## Reconstruct an L4 book

Start from a checkpoint route, then apply diffs in order. When no checkpoint exists for the requested timestamp, keep the error's `request_id` in your logs.

## Freshness and empty results

A pair can have no checkpoint at a given timestamp, or no records in a window, while the route itself is available. Treat that as a normal result and never fill in a book. Check `/v1/hyperliquid/spot/freshness/{symbol}` before reconstruction, alerting, exports, or model inputs depend on Spot data.

## Next step

Confirm the pair's history start for each data type in [Venue coverage](/venue-coverage).


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