Skip to main content

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.

SDKs wrap the same REST routes shown in the generated reference. Keep route family selection explicit in code.
from os import environ
from oxarchive import Client

client = Client(api_key=environ["OXARCHIVE_API_KEY"])
book = client.hyperliquid.orderbook.get("BTC")
print(book.symbol, book.mid_price)
If an SDK method name differs from these examples, follow the package README and generated types. The REST reference remains the route contract.

SDK Namespace Map

SDKs should keep venue families visible in the client namespace. The exact method names differ by runtime; keep the family name visible in wrappers, tests, and review notes.
FamilyCommon package shapeExample symbolFallback when helper is absent
Hyperliquid coreclient.hyperliquid.*BTCGenerated REST route under /v1/hyperliquid/*
HIP-3client.hyperliquid.hip3.*km:US500Generated REST route under /v1/hyperliquid/hip3/*
Lighter.xyzclient.lighter.*BTCGenerated REST route under /v1/lighter/*
Hyperliquid SpotTypeScript/Python: client.spot.*; Rust: client.hyperliquid.spot.*HYPE-USDCGenerated REST route under /v1/hyperliquid/spot/*
HIP-4client.hyperliquid.hip4.* where the installed package exposes HIP-4 helpers#0 or outcome-side identifierGenerated REST route under /v1/hyperliquid/hip4/*
Keep this map visible in wrappers and tests. A generic getOrderbook(symbol) helper should still name the venue family in its config or function signature. Check the package README and installed version before copying helper names into shared code. Helper names can differ by runtime, but the route-family boundary should stay visible.

REST Fallback

Use direct REST as a first-class path when you need the exact generated route shape or when the runtime does not use one of the listed packages.
Direct REST
from os import environ
import requests

res = requests.get(
    "https://api.0xarchive.io/v1/hyperliquid/orderbook/BTC",
    headers={"X-API-Key": environ["OXARCHIVE_API_KEY"]},
    timeout=20,
)
res.raise_for_status()
payload = res.json()
print(payload["data"]["symbol"], payload["meta"]["request_id"])
The fallback path should use the same API key, response-envelope rules, request-ID logging, and data-quality gates as SDK code.

Response Handling

SDK callers should still understand the REST envelope. Preserve success, data, meta.count, meta.next_cursor, and meta.request_id where the route returns them. When the SDK unwraps data, expose metadata separately so retries, support workflows, and audit logs do not lose the request ID.

Error And Metadata Handling

SDK errors should preserve enough context for support and retries.
import { OxArchive, OxArchiveError } from "@0xarchive/sdk";

const client = new OxArchive({
  apiKey: process.env.OXARCHIVE_API_KEY!,
  timeout: 30_000
});

try {
  const orderbook = await client.hyperliquid.orderbook.get("BTC", { depth: 20 });
  console.log(orderbook.symbol, orderbook.midPrice);
} catch (error) {
  if (error instanceof OxArchiveError) {
    console.error(error.code, error.message, error.requestId);
  }
  throw error;
}
If the route returns metadata separately from the SDK data object, log it beside the data result. If the SDK throws a structured error, keep the status or code and request ID with the failed job.

Pagination And History

For historical routes, design SDK loops around bounded windows and cursors. Store each request path, query parameters, cursor, and request ID with the output. Do not widen a job across many symbols until one window confirms schema, data-quality state, and rate behavior.
let page = await client.hyperliquid.trades.list("BTC", {
  start: Date.now() - 86_400_000,
  end: Date.now(),
  limit: 1000
});

while (page.nextCursor) {
  page = await client.hyperliquid.trades.list("BTC", {
    start: Date.now() - 86_400_000,
    end: Date.now(),
    cursor: page.nextCursor,
    limit: 1000
  });
}
Pair large SDK pulls with Data Quality and Rate Limits. Use Data Catalog instead when the job is a large file export or warehouse load.

Review Rule

Generated SDK examples should show where auth comes from, how errors are surfaced, and where metadata lives. If the SDK hides metadata by default, add a wrapper or logging hook so production callers can still recover request IDs. Include one route fixture per venue family and test metadata propagation before widening a shared wrapper.
Last modified on May 18, 2026