1.12.0.
Set your key once. Each example below reads it from the environment:
- Python
- TypeScript
- Rust
Python 3.9 or later:For live streams and replay, install
first_call.py
pip install 'oxarchive[websocket]==1.12.0'. Source: 0xArchiveIO/sdk-python.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 underclient.hyperliquid.hip3and HIP-4 underclient.hyperliquid.hip4. - Hyperliquid Spot:
client.spotin Python and TypeScript, andclient.hyperliquid.spotin Rust. - Lighter:
client.lighter. Lighter on Robinhood Chain:client.rh_lighterin Python and Rust, andclient.rhLighterin TypeScript.
Errors
A failed request raisesOxArchiveError 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.