Skip to main content
Get a key, call the BTC order book once, and read the full response. About a minute, no client library required.
1

Create a key

Open the dashboard and create an API key. The free tier needs no card.
2

Set it in your shell

export OXARCHIVE_API_KEY="0xa_your_api_key"
3

Call the BTC order book

curl "https://api.0xarchive.io/v1/hyperliquid/orderbook/BTC" \
  -H "X-API-Key: $OXARCHIVE_API_KEY"

The response

Every market-data route returns the same envelope: success, data, and meta. Here is the full BTC order book response, top levels shown:
{
  "success": true,
  "data": {
    "coin": "BTC",
    "symbol": "BTC",
    "timestamp": "2026-06-05T13:53:33.971Z",
    "bids": [
      { "px": "61077.0", "sz": "0.0003", "n": 1 },
      { "px": "61075.0", "sz": "1.60628", "n": 6 }
    ],
    "asks": [
      { "px": "61078.0", "sz": "11.73086", "n": 32 },
      { "px": "61079.0", "sz": "1.45565", "n": 4 }
    ],
    "mid_price": "61077.5",
    "spread": "1",
    "spread_bps": "0.16372641316360362"
  },
  "meta": {
    "request_id": "req_8f3c1a9e2b7d4f60"
  }
}
  • px and sz are decimal strings. Parse them as decimals, not floats, when you need exact values.
  • n is the number of resting orders at that price level.
  • Keep meta.request_id (or the x-request-id response header) for logs and support.
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()
book = payload["data"]
print(book["symbol"], book["mid_price"], payload["meta"]["request_id"])

When a call fails

Most first-call failures are a missing or wrong key (401). Check your X-API-Key. Errors use the same envelope as success, with an error object:
{
  "success": false,
  "error": {
    "code": "rate_limited",
    "message": "Rate limit exceeded"
  },
  "meta": {
    "request_id": "req_0a1b2c3d4e5f6071"
  }
}
CodeMeansDo
400Bad parameter, symbol, or time rangeFix the request before retrying
401Missing or invalid API keyCheck X-API-Key and key status
403Key lacks access to the route or gated dataChoose another route or upgrade access
429Rate, concurrency, or credit limit reachedHonor Retry-After, otherwise back off
Full codes, retry rules, and request-ID handling are on Errors And Request IDs. For credits, concurrency, and per-plan limits, see Rate Limits. Keep the failed meta.request_id or x-request-id when you ask for support.

Next

Browse REST routes

Parameters, schemas, examples, and credits, backed by OpenAPI.

Check venue coverage

Pick the right namespace and confirm the history window before wiring symbols.

Connect WebSocket

Stream live data or replay historical sequences over one socket.

Choose tooling

Move from curl to SDKs, CLI, MCP Server, Skill, or OpenAPI codegen.

Free tier, no card

Get a key and run a real call

New accounts start free, no card required. Create a key in the dashboard and paste it into any example here.

Create a key →
Last modified on June 12, 2026