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

# Quickstart

> Create an API key and make one authenticated 0xArchive REST request.

Make one authenticated BTC order book request before moving into REST reference pages, WebSocket, SDKs, CLI, or AI clients.

<Steps>
  <Step title="Create or open your account">
    Open the [dashboard](https://www.0xarchive.io/dashboard/) and create an API key.
  </Step>

  <Step title="Set the key locally">
    Store the key as an environment variable before running examples.

    ```bash theme={"theme":"github-dark"}
    export OXARCHIVE_API_KEY="0xa_your_api_key"
    ```
  </Step>

  <Step title="Call the BTC order book route">
    ```bash theme={"theme":"github-dark"}
    curl "https://api.0xarchive.io/v1/hyperliquid/orderbook/BTC" \
      -H "X-API-Key: $OXARCHIVE_API_KEY"
    ```
  </Step>

  <Step title="Inspect the envelope">
    This market-data route returns `success`, `data`, and `meta`. Keep `meta.request_id` when debugging a request.
  </Step>
</Steps>

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

  res = requests.get(
      "https://api.0xarchive.io/v1/hyperliquid/orderbook/BTC",
      headers={"X-API-Key": os.environ["OXARCHIVE_API_KEY"]},
      timeout=20,
  )
  res.raise_for_status()
  payload = res.json()
  print(payload["data"]["symbol"], payload["meta"]["request_id"])
  ```

  ```javascript JavaScript theme={"theme":"github-dark"}
  const res = await fetch("https://api.0xarchive.io/v1/hyperliquid/orderbook/BTC", {
    headers: { "X-API-Key": process.env.OXARCHIVE_API_KEY }
  });

  if (!res.ok) throw new Error(`0xArchive request failed: ${res.status}`);
  const payload = await res.json();
  console.log(payload.data.symbol, payload.meta.request_id);
  ```

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

## Response Checks

<ResponseField name="success" type="boolean">
  `true` on a 2xx response.
</ResponseField>

<ResponseField name="data" type="object">
  The route payload. For an order book, expect symbol fields, timestamp, bids, asks, and spread fields.
</ResponseField>

<ResponseField name="meta.request_id" type="string">
  Request identifier for logs and support.
</ResponseField>

## First Request Record

Record the choices that make the first response repeatable.

| Field          | Record                                                                         |
| -------------- | ------------------------------------------------------------------------------ |
| Key source     | Environment variable, secret manager, notebook secret, or CLI session variable |
| Route family   | Hyperliquid core, Hyperliquid Spot, HIP-3, HIP-4, or Lighter                   |
| Request path   | Full method, path, query parameters, and symbol exactly as called              |
| Response shape | Whether the response returned `success`, `data`, and `meta.request_id`         |
| Data timestamp | The market-data timestamp returned by the body, when present                   |
| Next branch    | REST reference, playground, WebSocket, SDK, CLI, MCP Server, Skill, or OpenAPI |

The record should fit in a commit note, issue, support request, or prompt to a coding agent. If the next branch is unclear, stay on the generated REST reference until the route family and payload shape are clear.

## First Successful Response

Treat the quickstart as complete only after the first successful response is observed and logged. Creating the key is step one; activation is the first authenticated market-data response that confirms the key source, `X-API-Key` header, route namespace, response envelope, and request-ID handling work together.

If the request does not complete, keep the failed attempt visible instead of jumping to a client wrapper. For `401`, check the key source and header name. For `404`, check [Venue Coverage](/venue-coverage). For `429`, read [Rate Limits](/rate-limits) and preserve the failed request ID from `meta.request_id`, `x-request-id`, or the client wrapper. For malformed parameters or unsupported time windows, inspect [Errors And Request IDs](/errors) before retrying unchanged.

## Branch By Job

<CardGroup cols={2}>
  <Card title="Browse REST routes" icon="square-terminal" href="/rest-api">
    Use OpenAPI-backed pages for parameters, schemas, examples, and credits.
  </Card>

  <Card title="Check venue coverage" icon="layers" href="/venue-coverage">
    Pick the right namespace before you wire symbols into a client.
  </Card>

  <Card title="Connect WebSocket" icon="radio" href="/websocket/connection">
    Stream live data or replay historical sequences over one socket.
  </Card>

  <Card title="Choose tooling" icon="wrench" href="/tooling">
    Move from curl to SDKs, CLI, MCP Server, Skill, OpenAPI codegen, or coding-agent workflows.
  </Card>
</CardGroup>

## Confirmation Boundary

The first request confirms the key, route namespace, response envelope, and request-ID handling. It does not confirm every symbol, data family, time window, access-gated route, or replay workflow available to the same key.

For one-off payload inspection, stay in REST and the playground. For backtesting, add historical parameters, pagination, and data-quality checks. For streaming or replay, move to WebSocket. For shell-native automation, use the CLI. For generated clients or coding-agent work, open the pinned OpenAPI first so the route shape comes from the contract.

## Common First Mistakes

Most early failures come from one of three sources: missing `X-API-Key`, wrong venue family, or long-history requests before limits and freshness are checked. Keep the first request small, log the full path and request handle, then switch to Spot, HIP-3, HIP-4, Lighter, or higher-depth workflows.

## Expansion Gate

Pause before loops, exports, replay, or high-concurrency scripts when any of these are missing: exact route family, saved request ID, known limit behavior, freshness check, or a clear reason to use REST, WebSocket, SDKs, CLI, MCP Server, Skill, or OpenAPI. The first successful curl starts client design; it is not the whole integration.
