Skip to main content
Copy a working request for REST, WebSocket, or an AI agent. Each example keeps the venue family and symbol format intact, authenticates correctly, and logs the request ID, and each one runs on a Free key. Full runnable projects are in 0xArchiveIO/examples; exact parameters and schemas are in the Endpoint reference and OpenAPI.

REST requests

Set the API key in the environment first:

Check data quality first

Before a backtest, alert, export, dashboard, or model trusts a result, check coverage for the family and symbol:
If coverage, incidents, or freshness fall outside what the job can tolerate, stop, narrow the request, or mark the output. Do not fill gaps silently. Coverage responses have their own body instead of the success, data, and meta envelope, so store the coverage payload, the route and parameters, and the request ID of the market-data call it gates.

Page through history

Start with a bounded window and keep the cursor. This window, the hour that ended one hour ago, is inside every plan’s history, including Free’s most recent 30 days:
If the response includes meta.next_cursor, pass that value back as cursor with the same route, symbol, START, and END. Store each cursor and meta.request_id beside the output, so a later run can show which pages produced the dataset.

Handle the response

Keep numeric market fields decimal-safe in production. Prices, sizes, funding rates, open interest, spreads, and HIP-4 probability prices should not pass through floating-point math when precision matters.

Stream over WebSocket

The WebSocket takes the key in the opening handshake as Authorization: Bearer $OXARCHIVE_API_KEY.
Keep WebSocket credentials on the server. Browser WebSocket clients cannot set the required authorization header, so browser apps should connect through your backend. Never expose a real API key in browser code, public prompts, logs, screenshots, or shared notebooks.
A long-running client also needs keep-alive, reconnect backoff, subscription restore, unsubscribe, and backpressure handling; see Keep-alive.

Export files

For historical files rather than responses, build the export in the Data Catalog: choose the market (for example Hyperliquid Spot HYPE-USDC), the schemas (such as trades and l2_orderbook), and a UTC range, review the price in export credits, and record your data-rights decision. Export schemas lists the columns, and Export checkout covers payment and delivery.

Ask an agent

Use 0xArchive to pull Hyperliquid Spot HYPE-USDC trades for one bounded window. First name the route family, then show the REST path, auth header, response envelope fields to log, freshness preflight, and retry behavior.

SDK examples are on SDK REST usage, and command-line examples on CLI.

Next step

See the full response for each data family in Example responses.
Last modified on October 6, 2026