๐Ÿ”Œ API & Developers

Hyperliquid l2Book Info Endpoint: Order Book Depth Snapshot Request and Response

โš ๏ธ Disclosure: Some links on this page are affiliate links. If you sign up through them, I may earn a commission โ€” at no extra cost to you.
To request an L2 order-book depth snapshot from Hyperliquid, send a POST request to https://api.hyperliquid.xyz/info with type set to "l2Book" and a required coin field. The endpoint returns at most 20 levels per side, according to the Hyperliquid info endpoint documentation available on 2026-11-18.

Request

Use the Content-Type: application/json header.

FieldRequiredTypeDescription
typeYesStringMust be "l2Book"
coinYesStringCoin to query
nSigFigsNoNumberOptional aggregation to significant figures. Valid values are 2, 3, 4, 5, and null; null means full precision
mantissaNoNumberOptional aggregation field. Allowed only when nSigFigs is 5. Accepts 1, 2, or 5
Basic request example:

{
  "type": "l2Book",
  "coin": "BTC"
}

Aggregated request example:

{
  "type": "l2Book",
  "coin": "BTC",
  "nSigFigs": 5,
  "mantissa": 1
}

Response

The response is an object with coin, time, and levels.

๐Ÿ’ก Hyperliquid

Like what you're reading? Try it yourself โ€” this link supports ChartedTrader at no cost to you.

Create a Hyperliquid account and get a 4% fee discount on the first $25M of volume; Vaults and sub-accounts are excluded. โ†’
๐ŸŽ You receive: 4% fee discount on first $25M volume ยท per account, lifetime

FieldDescription
coinCoin returned in the request
timeTimestamp from the documented response shape
levelsArray containing two side arrays
Each level entry contains:
FieldDescription
pxPrice
szSize
nDocumented as number of levels
In the documented example, the first side array contains lower prices and the second side array contains higher prices. The endpoint returns at most 20 levels per side.

Reference response example from the documentation:

{
  "coin": "BTC",
  "time": 1754450974231,
  "levels": [
    [
      {
        "px": "113377.0",
        "sz": "7.6699",
        "n": 17
      },
      {
        "px": "113376.0",
        "sz": "4.13714",
        "n": 8
      }
    ],
    [
      {
        "px": "113397.0",
        "sz": "0.11543",
        "n": 3
      }
    ]
  ]
}

Coin naming

For perpetuals, coin is the name returned in the meta response. For spot, use PURR/USDC for PURR, or @{index} for other spot tokens, where the index is the spot-pair index from the universe field of the spotMeta response. See Hyperliquid API Asset IDs for the broader asset-ID mapping. For general order-book context, see Hyperliquid HyperCore order book explained.

Affiliate disclosure

The Hyperliquid account link below is a referral link and may earn a commission.

Create a Hyperliquid account

Continue with Hyperliquid

Browse the Hyperliquid guide hub for the complete user journey.

๐Ÿงฎ Free Hyperliquid calculators

Fee Calculator โ†’
Hyperliquid vs centralized exchange fee comparison
PnL & Liquidation โ†’
Perp PnL + liquidation price
Position Size โ†’
Risk-aware position sizing for HL perps
Hyperliquid

Ready to get started? Use the link below โ€” it helps support ChartedTrader at no cost to you.

Create a Hyperliquid account and get a 4% fee discount on the first $25M of volume; Vaults and sub-accounts are excluded. โ†’
๐ŸŽ You receive: 4% fee discount on first $25M volume ยท per account, lifetime
๐Ÿ“ˆ

About the author

I'm a systematic trader running live strategies on IB (USDJPY momentum) and Hyperliquid (crypto perps). Questions? Reach out.

๐Ÿ“š Related Articles

๐Ÿ”Œ
API & Developers

Hyperliquid API Websocket Guide for Developers (2026)

Connect to Hyperliquid WebSocket endpoints, subscribe to basic feeds, send post requests, and keep the connection alive with ping/pong and reconnect handling.

July 29, 2026 โฑ 8 min read
๐Ÿ”Œ
API & Developers

Hyperliquid WebSocket Subscriptions: Message Formats, Types, and Examples

How to subscribe to Hyperliquid WebSocket feeds, with subscription message formats, supported types, snapshots, unsubscribe messages, and user-address pitfalls.

November 9, 2026 โฑ 5 min read
๐Ÿ”Œ
API & Developers

Hyperliquid Python SDK Tutorial: Build a Bot (2026)

Build a production-ready trading bot on Hyperliquid using the official Python SDK. Covers API wallet security, order execution, WebSocket feeds, and common pitfalls to avoid.

May 6, 2026 โฑ 12 min read