Hyperliquid API Explained: Endpoints, Rate Limits, WebSocket and Historical Data

November 17, 2026
By Hyperdash
The Hyperliquid API is the public interface to the Hyperliquid exchange. It has three parts: an info endpoint that returns market and account data, an exchange endpoint that accepts signed orders and transfers, and a WebSocket that streams live updates. Reading data needs no API key. The API is built for trading and live state, so it returns only recent history: at most 5,000 candles per market and the 10,000 most recent fills per wallet.
This guide covers each part, the rate limits, how much history each request returns, and how to get full historical data when the public API runs out.
Published
November 17, 2026
Author
Hyperdash
Reading time
7 min read
Category
Data API
What is the Hyperliquid API?
Hyperliquid runs one API for its order book exchange, HyperCore. Every request goes to https://api.hyperliquid.xyz on mainnet or https://api.hyperliquid-testnet.xyz on testnet.
| Part | Address | What it does | Key needed |
|---|---|---|---|
| Info endpoint | POST /info | Market data, order books, candles, funding, and any wallet's positions, orders and fills | No |
| Exchange endpoint | POST /exchange | Places and cancels orders, sets leverage, moves funds | Signed by the wallet or an approved API wallet |
| WebSocket | wss://api.hyperliquid.xyz/ws | Live trades, order books, candles, and a wallet's fills and orders | No for market data |
The official API documentation lists every request type. Hyperliquid also maintains an official Python SDK, installed with pip install hyperliquid-python-sdk, which wraps signing for the exchange endpoint.
How do you get market data from the Hyperliquid API?
Every info request is a POST to /info with a JSON body that names the request type. This one returns the BTC order book:
curl -X POST https://api.hyperliquid.xyz/info -H "Content-Type: application/json" -d '{"type": "l2Book", "coin": "BTC"}'
The most used request types are:
- allMids: the mid price of every market.
- metaAndAssetCtxs: every perp market with its mark price, funding rate, open interest and 24-hour volume.
- l2Book: the order book, up to 20 price levels per side.
- candleSnapshot: candles for one market and interval.
- fundingHistory: past funding rates for one market.
- clearinghouseState: one wallet's positions and margin.
- userFills and userFillsByTime: one wallet's fills.
What are the Hyperliquid API rate limits?
REST requests share a limit of 1,200 weight per minute per IP address. Each request type has a weight, and requests that return long lists add weight for every 20 items returned (60 for candles).
| Limit | Value |
|---|---|
| REST weight per IP | 1,200 per minute |
| l2Book, allMids, clearinghouseState, orderStatus | Weight 2 |
| Most other info requests | Weight 20 |
| WebSocket connections | 10 per IP |
| New WebSocket connections | 30 per minute |
| WebSocket subscriptions | 1,000 |
| Messages sent over WebSocket | 2,000 per minute |
At weight 20, an IP can make about 60 info requests a minute. Polling many wallets or markets reaches the limit quickly, which is why most applications move to the WebSocket for live data. Exchange actions have a separate per-address limit that grows with the account's traded volume. Full details are in Rate limits and user limits.
How much history does the Hyperliquid API return?
The public API returns recent data only. Each history request has a fixed cap, and older data cannot be requested.
| Request | Limit |
|---|---|
| userFills | 2,000 most recent fills |
| userFillsByTime | 2,000 per response, and only the 10,000 most recent fills are available |
| historicalOrders | 2,000 most recent orders |
| candleSnapshot | Only the 5,000 most recent candles |
| l2Book | 20 levels per side, current book only |
| Time-range requests | 500 items per response; page with the last timestamp |
In practice, 5,000 one-minute candles cover about three and a half days. An active wallet can pass 10,000 fills in a week, after which its older fills are no longer available from the API. There is no request for a past order book or for the full trade tape of a market.
Where can you get historical Hyperliquid data?
There are three routes, depending on how much work you want to do.
Hyperliquid's S3 archive. Hyperliquid uploads L2 book snapshots and asset contexts to the hyperliquid-archive bucket about once a month, and node fills to hl-mainnet-node-data. The requester pays the transfer cost, there is no guarantee of timely updates, and candles are not included. The files are compressed and need parsing before use. Details are on the historical data page.
Run your own node. A non-validating node can write every fill and block to disk. It needs a server, storage and ongoing maintenance, and it only records data from the day it starts.
Use a data API. The Hyperdash Data API serves live and historical Hyperliquid data from Hyperdash's own nodes and history store, through ordinary REST requests with pagination.
| Dataset | Available from |
|---|---|
| Wallet ledger, funding payments and completed trades | February 26, 2023 |
| Liquidation, funding, fee and volume totals per market | March 30, 2023 |
| Market trade tape, funding rates and open interest | May 20, 2023 |
| Wallet fills, candles, leaderboards and trader analytics | March 22, 2025 |
| Liquidation events | July 28, 2025 |
Hyperliquid API vs the Hyperdash Data API
The two are built for different jobs. The Hyperliquid API is the way to trade. The Hyperdash Data API is read-only and built for history, analytics and reading many wallets at once.
| Hyperliquid API | Hyperdash Data API | |
|---|---|---|
| Purpose | Trading and live state | Live and historical data |
| Places orders | Yes | No, read-only |
| Fill history per wallet | 10,000 most recent | Every fill, by time range |
| Candles | 5,000 most recent | 1 minute to 1 month, by time range |
| Past order books | No | 20-level book for each minute of the last 30 days |
| Liquidation history | No | Every liquidation with realized PnL |
| Many wallets in one request | No | Up to 10,000 wallets per batch request |
| Trader analytics | No | Leaderboards, cohort positioning, liquidation maps |
| AI agent access | No | Hosted MCP server |
| Cost | Free | From $20 a month |
Requests use a bearer key and query parameters instead of a JSON body. This one returns a wallet's fills for a time range, in epoch milliseconds:
curl "https://data.hyperdash.com/v1/accounts/0xADDRESS/fills?start_time=1762300800000&end_time=1762905600000&limit=1000" -H "Authorization: Bearer $HYPERDASH_API_KEY"
Each response includes a next_cursor for the next page. The full list of endpoints is in the API reference, and the launch post Hyperdash Data API Is Live covers plans and pricing.
How do you stream Hyperliquid data over WebSocket?
On the public API, connect to wss://api.hyperliquid.xyz/ws and send a subscription message. This one subscribes to BTC trades:
{"method": "subscribe", "subscription": {"type": "trades", "coin": "BTC"}}
Available subscriptions include trades, l2Book, candle, allMids, and a wallet's userFills and orderUpdates. If the connection drops, any messages sent while it was down are lost, and the client has to backfill from the info endpoint.
The Hyperdash stream at wss://data.hyperdash.com/v1/stream works the same way, with two differences. Each batch of events carries a cursor, so a client that reconnects resumes where it left off instead of losing data. And it adds channels the public API does not have, including liquidations across every market, liquidation and stop-order levels, and every trade with both the taker and maker wallet. The channel list is in the Streams docs.
How can AI agents query Hyperliquid data?
AI agents can query Hyperliquid data through the Hyperdash MCP server at https://data.hyperdash.com/mcp. Claude, ChatGPT, Cursor, Codex and any other MCP client can connect to it and ask for funding, order books, liquidations or a wallet's history in plain language. The server has one tool per API endpoint and returns the same data as the REST API.
For agents that call the REST API directly, the OpenAPI spec and an endpoint index written for language models are public. Setup steps are in Build with AI.
FAQ
Is the Hyperliquid API free?
Yes. The public info endpoint, exchange endpoint and WebSocket are free to use within the rate limits.
Do I need an API key for the Hyperliquid API?
Not to read data. Info requests and market data subscriptions need no key. Orders and transfers must be signed by the wallet or by an API wallet the account has approved.
What is a Hyperliquid API wallet?
An API wallet, also called an agent wallet, is a separate key that an account approves to sign orders on its behalf. It can trade but cannot withdraw funds.
What is the Hyperliquid API rate limit?
1,200 weight per minute per IP for REST requests. Most info requests weigh 20, so about 60 per minute. WebSocket connections are limited to 10 per IP and 1,000 subscriptions.
Does the Hyperliquid API have a testnet?
Yes. The testnet API is at https://api.hyperliquid-testnet.xyz and works the same as mainnet.
How do I get more than 10,000 fills for a Hyperliquid wallet?
The public API stops at the 10,000 most recent fills. Older fills are in Hyperliquid's node data on S3, or available by time range from the Hyperdash Data API.
How do I get historical Hyperliquid candles?
The public API returns only the most recent 5,000 candles per interval. The Hyperdash Data API returns candles from 1 minute to 1 month by time range, from March 22, 2025.
Is there an official Hyperliquid Python SDK?
Yes. Install it with pip install hyperliquid-python-sdk. It covers the info and exchange endpoints and handles request signing.
Get started
Use the public Hyperliquid API to trade and read live state. For full history, many wallets at once, or analytics, get a Hyperdash Data API key and read the Quickstart.

