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

> Request Hyperliquid and Lighter snapshots, history windows, and data-quality checks over HTTPS: pick the endpoint family, then send one authenticated request.

Request Hyperliquid and Lighter snapshots, history windows, and data-quality checks over HTTPS, with one API key in the `X-API-Key` header.

## Make one request

With your key in `OXARCHIVE_API_KEY`, this returns the best bid and ask for BTC:

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

A successful call returns HTTP `200`:

```json theme={"theme":"github-dark"}
{
  "success": true,
  "data": {
    "coin": "BTC",
    "symbol": "BTC",
    "timestamp": "2026-10-06T17:41:53.500Z",
    "bids": [{ "px": "85551", "sz": "3.91467", "n": 7 }],
    "asks": [{ "px": "85552", "sz": "17.29869", "n": 68 }],
    "mid_price": "85551.5",
    "spread": "1",
    "spread_bps": "0.1168886577090992",
    "source": "node"
  },
  "meta": {
    "count": 1,
    "request_id": "8bc1716d-b797-4d5a-83bc-419c67b8c052",
    "symbol": "BTC",
    "venue": "hyperliquid"
  }
}
```

Every request goes to `https://api.0xarchive.io`. Market-data routes answer with `{ success, data, meta }` and a `meta.request_id`. Errors answer with `success: false`, a stable `error_code`, and a top-level `request_id`. A few auth, system, wallet, and data-quality routes return their own body; the endpoint page shows it. `GET /health` is unauthenticated liveness and does not check your key. The [Quickstart](/quickstart) walks through the same call and the errors you are most likely to see.

## Pull history

[Pull historical market data](/guides/historical-market-data) walks one bounded window page by page, with the cursors and request IDs that make it reproducible. The Free plan covers the most recent 30 days; longer history needs Build or above.

## Choose the endpoint family

Each market type has its own namespace. Pick it first, then the dataset.

| Market | Namespace and example symbol |
| - | - |
| Hyperliquid perpetuals | `/v1/hyperliquid/*` with `BTC` |
| Hyperliquid Spot | `/v1/hyperliquid/spot/*` with `HYPE-USDC` |
| HIP-3 builder perpetuals | `/v1/hyperliquid/hip3/*` with `xyz:TSLA` (the prefix is case-sensitive) |
| HIP-4 outcome markets | `/v1/hyperliquid/hip4/*` with a side coin from `/outcomes`, such as `#0`, URL-encoded as `%230`; prices are probabilities |
| Lighter | `/v1/lighter/*` with `BTC` |
| Lighter on Robinhood Chain | `/v1/rh-lighter/*` with `BTC` or `AAPL-USDG` |

Datasets: [order books](/rest-api/order-books) (L2, L3, and L4), [trades](/rest-api/trades), [candles](/rest-api/candles), [funding](/rest-api/funding), [open interest](/rest-api/open-interest), [liquidations](/rest-api/liquidations), [orders](/rest-api/order-history), [account positions](/rest-api/positions), and [data quality](/rest-api/data-quality). Account positions sit under the same namespaces: `/wallets/{address}/positions` on Hyperliquid and HIP-3, and `/accounts/{account_index}/positions` on both Lighter deployments.

[Venue coverage](/venue-coverage) shows which datasets each market type has, and from when. Start with one symbol and a short UTC window before widening a job.

## Requests and responses

<CardGroup cols={2}>
  <Card title="Parameters" icon="table" href="/rest-api/parameters">
    Symbols, time windows, intervals, depth, limits, and filters.
  </Card>

  <Card title="Pagination" icon="repeat" href="/rest-api/pagination">
    Cursors and resumable backfills.
  </Card>

  <Card title="Responses" icon="braces" href="/responses">
    The success shape and every field in it.
  </Card>

  <Card title="Errors" icon="circle-alert" href="/errors">
    Status codes, retry timing, and request IDs.
  </Card>

  <Card title="Rate limits" icon="gauge" href="/rate-limits">
    Requests, credits, and concurrency per plan.
  </Card>

  <Card title="OpenAPI" icon="file-code" href="/openapi">
    Every operation, parameter, and schema, for code generation.
  </Card>
</CardGroup>

Need a stream, alerts, or files instead? [Choose a product](/data). To run these requests from an SDK, the CLI, or an AI client, see [Choose an interface](/tooling).

## Next step

Open the [Endpoint reference](/api-reference) and pick the route for your namespace and dataset.


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