---
title: "SDK REST Usage | 0xArchive Docs"
description: "Use 0xArchive SDK REST helpers for venue routes, parameters, pagination, credits, response types, and production request patterns."
canonical_url: "https://www.0xarchive.io/docs/sdks/rest-usage/"
markdown_url: "https://www.0xarchive.io/docs/sdks/rest-usage.md"
route: "/docs/sdks/rest-usage"
robots: "index, follow"
generated_from: "prerendered_html"
---

# SDK REST Usage

REST usage in the SDKs tracks the route model in the main REST reference.

Pattern Client plus API key Coverage REST routes with typed helpers

[Installation](https://www.0xarchive.io/docs/sdks/installation/)

[Reconstruction](https://www.0xarchive.io/docs/sdks/reconstruction/)

Official clients for the core API in Python, TypeScript, and Rust.

## REST usage

SDK method names stay close to the REST routes.

```
# pip install oxarchive
from oxarchive import Client

client = Client(api_key="0xa_your_api_key")

# Hyperliquid data
hl_orderbook = client.hyperliquid.orderbook.get("BTC")
print(f"Hyperliquid BTC mid price: {hl_orderbook.mid_price}")

# Lighter.xyz data
lighter_orderbook = client.lighter.orderbook.get("BTC")
print(f"Lighter BTC mid price: {lighter_orderbook.mid_price}")

# HIP-3 builder perps
hip3_ob = client.hyperliquid.hip3.orderbook.get("xyz:XYZ100")
print(f"HIP-3 XYZ100 mid price: {hip3_ob.mid_price}")

hip3_trades = client.hyperliquid.hip3.trades.recent("xyz:XYZ100", limit=10)
print(f"Recent HIP-3 trades: {len(hip3_trades)}")

# Hyperliquid Spot (294 dashed pairs: PURR-USDC, HYPE-USDC, HFUN-USDC, ...)
spot_ob = client.hyperliquid.spot.orderbook.get("PURR-USDC")
print(f"Spot PURR-USDC mid price: {spot_ob.mid_price}")

spot_trades = client.hyperliquid.spot.trades.list(
    "PURR-USDC", start=1746489600000, end=1746576000000, limit=500
)
# Spot fills include builder_address, builder_fee, twap_id, fee_token (open-set), and a real EVM tx_hash on roughly 69% of rows
for t in spot_trades.data[:3]:
    print(t.timestamp, t.price, t.fee_token, t.builder_address, t.twap_id)

# HIP-4 outcome markets (binary Yes/No)
# Coins use the numeric id: 0 (Yes), 1 (No). The #-prefixed form ("#0", "#1") is also accepted.
hip4_outcomes = client.hyperliquid.hip4.outcomes.list(is_settled=False, limit=5)
for outcome in hip4_outcomes:
    print(f"Outcome {outcome.outcome_id}: {outcome.name}")

hip4_ob = client.hyperliquid.hip4.orderbook.get("0")
print(f"HIP-4 outcome 0 (Yes) implied probability: {hip4_ob.mid_price}")

# Get trades with cursor pagination
result = client.hyperliquid.trades.list("ETH", start="2026-01-01", end="2026-01-02", limit=1000)
trades = result.data

# Continue fetching all pages
while result.next_cursor:
    result = client.hyperliquid.trades.list(
        "ETH", start="2026-01-01", end="2026-01-02",
        cursor=result.next_cursor, limit=1000
    )
    trades.extend(result.data)
```

The published SDKs also expose data-quality monitoring and wallet helpers.
