l2Book | Hyperliquid Info API
Info API
l2Book | Hyperliquid Info API
Hyperliquid l2Book: fetch an aggregated Level-2 order book snapshot for a single coin - bids and asks as price, size, and order-count levels.
POST
l2Book | Hyperliquid Info API
Credit Cost
1 per call
Processing
Realtime
type: "l2Book" is used to fetch an aggregated Level-2 order book snapshot for a single coin - bids and asks as price, size, and order-count levels.
- Wire-equal to
POST api.hyperliquid.xyz/infowith{"type": "l2Book", "coin": "..."}. - Returns at most 20 levels per side.
- For a continuous push stream instead of polling snapshots, subscribe to the WebSocket API
l2Bookchannel (optional wildcardcoin) or the GoldRush-nativel2BookDifffor incremental updates.
coin: two arrays of price levels (bids first, then asks), each level carrying the price, the total resting size at that price, and the number of orders comprising it. Use it for a one-shot depth snapshot, spread checks, or seeding a book before switching to a diff stream.
Endpoint
Request
Always
"l2Book".The asset symbol, e.g.
"BTC". For HIP-3 markets use the deployer-prefixed form (e.g. "xyz:GOLD"); for spot use the pair symbol or @<index>.Number of significant figures to aggregate price levels to (
2-5). Omit or pass null for full precision.Optional mantissa for price-level bucketing. Only valid when
nSigFigs is 5. Omit or pass null for the default.Example
Response
A single JSON object.levels is a two-element array: element 0 is the bid side (descending price), element 1 is the ask side (ascending price). Each level is a {px, sz, n} object.
Field descriptions
px and sz are returned as decimal strings, preserving upstream precision. Do not parse them as floats.The asset the book is for - echoes the request
coin.Snapshot timestamp in milliseconds since Unix epoch.
Two-element array:
levels[0] are bids (sorted highest price first), levels[1] are asks (sorted lowest price first). Each side defaults to up to 20 aggregated levels.