# Hyperliquid L2 Order Book

> Hyperliquid L2 Order Book is a paid API for AI agents from hyperliquid.use.x402atlas.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-15).

Returns live L2 order book (bids and asks) for a single Hyperliquid asset with price, size, and order count up to 20 levels per side.

## Facts

- Endpoint: GET https://hyperliquid.use.x402atlas.com/book
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/hyperliquid-l2-order-book-d74d7e02
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_tFT1MjQpjS_TC34gqbqjy

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability hyperliquid-l2-order-book-d74d7e02
```

Example prompt: Pull the current L2 order book for BTC on Hyperliquid — I want to see the full bids and asks with prices and sizes.

## When to prefer this

Use this endpoint when you need real-time market depth data (bids and asks) for a specific Hyperliquid asset — either a perpetual (e.g. BTC) or a spot pair (e.g. PURR/USDC). Prefer this over mid-price endpoints when you need full book depth, spread analysis, or liquidity assessment rather than just the last price.

## Known failure modes

- Missing or invalid 'coin' query parameter returns an error
- Unknown or delisted asset symbol returns no data or an error
- Network timeout from Hyperliquid upstream results in a 5xx response
- Rate limiting or payment failure returns a 402 or 429 error

## How this service works

Live L2 order book for one Hyperliquid asset — bids and asks with price, size and order count, up to 20 levels per side.

## Output

Returns a JSON object containing arrays of bid and ask levels, each with price (px), size (sz), and number of orders (n) at that level, along with the asset symbol, the book timestamp reported by Hyperliquid, and the time the response was generated. Up to 20 levels are returned per side.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "coin"
     ],
     "properties": {
      "coin": {
       "type": "string",
       "maxLength": 32,
       "description": "Asset symbol (perp e.g. BTC, or spot pair e.g. PURR/USDC)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asks": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "n": {
          "type": "integer",
          "description": "Number of orders at this level"
         },
         "px": {
          "type": "string",
          "description": "Price (string for full precision)"
         },
         "sz": {
          "type": "string",
          "description": "Size (string for full precision)"
         }
        }
       }
      },
      "bids": {
       "type": "array",
       "items": {
        "type": "object",
        "properties": {
         "n": {
          "type": "integer",
          "description": "Number of orders at this level"
         },
         "px": {
          "type": "string",
          "description": "Price (string for full precision)"
         },
         "sz": {
          "type": "string",
          "description": "Size (string for full precision)"
         }
        }
       }
      },
      "coin": {
       "type": "string"
      },
      "time": {
       "type": "string",
       "format": "date-time",
       "description": "Book timestamp reported by Hyperliquid"
      },
      "queried_at": {
       "type": "string",
       "format": "date-time",
       "description": "When this response was generated"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "asks": [
   {
    "n": 2,
    "px": "64251.0",
    "sz": "0.8"
   }
  ],
  "bids": [
   {
    "n": 3,
    "px": "64249.0",
    "sz": "1.5"
   }
  ],
  "coin": "BTC",
  "time": "2026-07-10T12:00:00Z",
  "queried_at": "2026-07-10T12:00:00Z"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/hyperliquid-l2-order-book-d74d7e02/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from hyperliquid.use.x402atlas.com](https://www.zero.xyz/host/hyperliquid.use.x402atlas.com/llms.txt)
