Skip to main content
Call 0xArchive from Python, TypeScript, or Rust with typed requests, pagination, WebSocket helpers, and order-book reconstruction. All three SDKs are open source; these pages match version 1.12.0. Set your key once. Each example below reads it from the environment:
Python 3.9 or later:
first_call.py
For live streams and replay, install pip install 'oxarchive[websocket]==1.12.0'. Source: 0xArchiveIO/sdk-python.
A successful run prints BTC and the current mid price, such as BTC 85726.5. A missing or invalid key fails with a 401 error instead. Installation covers the WebSocket extras and pinned installs.

Venue clients

Each venue has its own client, so your code always names the market it reads:
  • Hyperliquid perpetuals: client.hyperliquid, with HIP-3 under client.hyperliquid.hip3 and HIP-4 under client.hyperliquid.hip4.
  • Hyperliquid Spot: client.spot in Python and TypeScript, and client.hyperliquid.spot in Rust.
  • Lighter: client.lighter. Lighter on Robinhood Chain: client.rh_lighter in Python and Rust, and client.rhLighter in TypeScript.
For another language, call the REST API directly or generate a client from OpenAPI.

Errors

A failed request raises OxArchiveError in Python and TypeScript, and returns Error::Api in Rust. Each carries the HTTP status, a stable error_code to branch on, and the request_id to quote to support. The SDKs send API version 2026-10-01, so a few codes are newer names than raw REST returns by default: a window older than your plan’s history is historical_depth_exceeded rather than history_window_exceeded. Errors lists every code.

Next step

REST usage

Request options, pagination, response handling, and the full namespace map for each SDK.
Last modified on October 6, 2026