allMids request on Hyperliquid's info endpoint returns midpoint prices for coins. According to the Hyperliquid Info endpoint docs, if a coin's order book is empty, the last trade price is used as a fallback.
Request
Send a POST request to:
https://api.hyperliquid.xyz/info
Use the Content-Type: application/json header.
Documented request body for allMids:
| Field | Required | Type | Description |
|---|---|---|---|
type | Yes | String | Must be "allMids" |
dex | No | String | Perp dex name. Defaults to the empty string, which represents the first perp dex. Spot mids are included only with the first perp dex. |
curl -X POST https://api.hyperliquid.xyz/info \
-H "Content-Type: application/json" \
-d '{"type":"allMids"}'
To request a specific perp dex:
curl -X POST https://api.hyperliquid.xyz/info \
-H "Content-Type: application/json" \
-d '{"type":"allMids","dex":"<perp-dex-name>"}'
Response format
Like what you're reading? Try it yourself โ this link supports ChartedTrader at no cost to you.
Create a Hyperliquid account โThe documented successful response is a JSON object mapping coin names to price strings:
{
"APE": "4.33245",
"ARB": "1.21695"
}
The response values are strings, not numeric types. Parse them as decimals in application code if needed.
Empty order book behavior
When the order book for a coin is empty, allMids does not return a midpoint calculated from bids and asks. Instead, the docs state that the last trade price is used as a fallback.
This matters when troubleshooting price displays or bot logic:
- A returned
allMidsvalue may be a true mid when the book has depth. - If the book is empty, the returned value may be the last trade price.
- To inspect actual order book depth, use the
l2Bookinfo endpoint, which returns up to 20 levels per side. See Hyperliquid l2Book Info Endpoint: Order Book Depth Snapshot Request and Response.
Related info endpoint requests
allMids is one of several request types on the same info endpoint. For user-specific market data such as open orders, fills, rate limits, and order status, see Hyperliquid Info Endpoint: User Open Orders, Fills, Rate Limits, and Order Status (2026).
Continue with Hyperliquid
Browse the Hyperliquid guide hub for the complete user journey.