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

# REST API

> REST reference for 0xArchive market data, venue coverage, Spot, data quality, and wallet automation routes.

The REST route atlas helps you pick the venue family and data family before opening endpoint-level parameters and schemas.

The REST API uses a stable base URL, API-key auth, and reference pages generated from the OpenAPI contract.

<Snippet file="request-lifecycle.mdx" />

<CardGroup cols={3}>
  <Card title="Order Books" icon="book-open" href="/rest-api/order-books">
    L2, L3, L4, snapshots, history, and depth-specific route selection.
  </Card>

  <Card title="Trades And Liquidations" icon="activity" href="/rest-api/trades-liquidations">
    Trade lists, liquidation events, flow windows, and venue-specific caveats.
  </Card>

  <Card title="Funding, OI, And Candles" icon="chart-no-axes-combined" href="/rest-api/funding-open-interest-candles">
    Perp context, open-interest series, candle windows, and model inputs.
  </Card>

  <Card title="Orders And L4 Lifecycle" icon="blocks" href="/rest-api/orders-and-l4-lifecycle">
    Order events, TP/SL, flow, L4 diffs, L4 history, and reconstruction.
  </Card>

  <Card title="Hyperliquid" icon="chart-candlestick" href="/rest-api/hyperliquid">
    Core perp routes for order books, trades, candles, funding, OI, liquidations, orders, and L4.
  </Card>

  <Card title="Hyperliquid Spot" icon="circle-dot" href="/rest-api/spot">
    Spot pairs, order books, trades, L4 reconstruction, order history, TWAP, and freshness.
  </Card>

  <Card title="HIP-3" icon="factory" href="/rest-api/hip3">
    Builder-perp routes under `/v1/hyperliquid/hip3`.
  </Card>

  <Card title="HIP-4" icon="binary" href="/rest-api/hip4">
    Outcome-market routes under `/v1/hyperliquid/hip4`.
  </Card>

  <Card title="Lighter.xyz" icon="zap" href="/rest-api/lighter">
    Lighter-specific L2/L3, trades, funding, OI, and reconstruction-oriented routes.
  </Card>

  <Card title="Data Quality" icon="shield-check" href="/rest-api/data-quality">
    Coverage, freshness, incidents, latency, status, and SLA routes.
  </Card>

  <Card title="Playground" icon="play" href="/playground">
    Send a request from the docs, then copy the equivalent curl command.
  </Card>
</CardGroup>

## Base Request

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

## Response Envelope

<Snippet file="response-envelope.mdx" />

## Generated Reference

Use the API Reference tab for endpoint pages with operation names, parameters, response schemas, auth, and examples.

## REST Request Packet

Before writing code or handing a route to an agent, capture the request packet that determines the correct family.

| Field            | Example                                                                                            |
| ---------------- | -------------------------------------------------------------------------------------------------- |
| Venue family     | Hyperliquid core, Spot, HIP-3, HIP-4, Lighter, or data quality                                     |
| Symbol format    | `BTC`, `HYPE-USDC`, `km:US500`, HIP-4 outcome ID, or Lighter symbol                                |
| Data family      | Order books, trades, candles, funding, OI, liquidations, L3, L4, freshness, or coverage            |
| Route path       | Generated REST path from OpenAPI, including namespace and path parameters                          |
| Request bound    | One symbol, one page, one short UTC window, or one status check before widening                    |
| Response context | Envelope, cursor, error code, decimal handling, and `meta.request_id`                              |
| Quality decision | Coverage, freshness, incidents, latency, or SLA context when downstream work depends on the result |

## Route Selection Rules

Choose the route family before choosing the endpoint. Standard Hyperliquid perp symbols such as `BTC` and `ETH` use `/v1/hyperliquid/*`. Spot pair symbols such as `HYPE-USDC` use `/v1/hyperliquid/spot/*`. HIP-3 builder markets such as `km:US500` use `/v1/hyperliquid/hip3/*`. HIP-4 outcome markets use `/v1/hyperliquid/hip4/*` and require probability-price handling. Lighter markets use `/v1/lighter/*`.

Endpoint reference pages define parameters and schemas. Curated pages explain which namespace to use, what the symbol format means, which data-quality check belongs near the request, and when WebSocket replay or SDK reconstruction is a better primitive than a REST list.

## Why 0xArchive Fits

0xArchive keeps route families, auth, examples, and response envelopes together so builders can move from first request to backtests, freshness checks, CLI jobs, MCP Server calls, or generated clients without relearning each venue surface.

## Next Step

Open [OpenAPI](/openapi) for the contract source, [Venue Coverage](/venue-coverage) for route-family selection, or [Choose An Interface](/tooling) when the same request should run through CLI, MCP Server, Skill, SDKs, or a coding agent.
