Save the specification
openapi.json in your current directory. Downloading the specification is public. For authenticated REST requests, send your key in the X-API-Key header; each operation declares its security requirements. See Authentication for key setup and public-route exceptions.
The specification covers REST routes. WebSocket commands and channels have a separate contract.
Generate a TypeScript client
Use Node.js 22.18 or newer and the downloadedopenapi.json in a local Node project. For a new project, run npm init --yes first. These commands use Hey API’s Fetch client generator:
src/client. The parser override selects a patched YAML dependency for the generator. Keep these tooling versions and your project lockfile with the specification when reproducing the client.
Run a public health check
Run a public health check
Save this as In a standalone project, compile and run it with:A successful response contains
health.ts. The public /health route lets you check the generated client without using an API key.health.ts
service: "0xarchive-api" and status: "ok". In an existing application, use your project’s TypeScript configuration instead of this standalone compile command.client.setConfig({ auth: () => apiKey }), where apiKey comes from your server’s secret configuration. The generated client uses the X-API-Key security header, not Bearer authentication. Keep private keys on your server, not in browser code.
Integration checks
- Route and venue: Choose the method, path, and venue family in Endpoint reference. Hyperliquid core, Spot, HIP-3, HIP-4, Lighter, and Lighter on Robinhood Chain have distinct routes and symbol formats.
- Parameters and time bounds: Read the route’s symbol format, filters, request limits, and time-window rules. Use Venue coverage when choosing a historical window.
- Authentication and responses: Set
X-API-Keyfor protected routes and handle the documented responses and the error codes on Errors. Keep the response envelope rather than assuming every route returns a bare array. - Pagination: Follow the route’s pagination rules, including
meta.next_cursorwhere provided. Validate one bounded request, for example in the API playground, before expanding the workload. - Schemas: Inspect the operation and component JSON schemas in Schemas when code generation or validation needs them.
Versions and troubleshooting
Keep the downloaded specification alongside your generated client so the same input can reproduce that client. When refreshing it, compare the routes and schemas your application uses, regenerate the client, and run your integration checks. The specification version above comes from the JSON contract; this article’s modification date is not an API version.Specification sources and route mismatches
Specification sources and route mismatches
Endpoint reference uses the specification bundled with these docs. The docs host serves that JSON directly and keeps semantic parity with
https://0xarchive.io/openapi.json.If a route differs between the JSON and its reference page, use the public JSON contract for code generation. Contact 0xArchive with the method, path, specification version, and request ID when available so the discrepancy can be checked.