POST /info/l2Book
Auth X-Hub-Key from API_HUB_KEYExecute
POST /run/hyperliquid/info/l2BookCache executed live on every call — a read-only POST answer is never cachedCost free · weight 0 · standard rate classSource billing freeL2 order-book snapshot for one coin: aggregated bid and ask levels with price, size and order count.
Parameters
| name | in | type | description | |
|---|---|---|---|---|
coin | body | str | required | Exchange coin symbol, e.g. BTC or ETH. example: BTC |
n | body | int | optional | Number of levels per side (1-20; upstream default 20). default: 20example: 5 |
Response
type: object
data key: levels
pagination: none
sample: {
"coin": "str",
"time": "int",
"levels": "array[2]"
}
Safe request
Reads the credential from API_HUB_KEY; it never appears in the URL.
curl -sX POST "https://openapihub.dev/run/hyperliquid/info/l2Book" \
-H "X-Hub-Key: $API_HUB_KEY" -H "Content-Type: application/json" \
-d '{"coin": "BTC", "n": 5}'