> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ironflow.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Hyperliquid order book (L2)

> GET /v1/book returns the live L2 order book of one Hyperliquid market: up to 20 levels a side with size and order count, mid, spread and USD depth. No key needed.



## OpenAPI

````yaml GET /v1/book
openapi: 3.1.0
info:
  title: Ironflow API
  version: 1.0.0
  description: >
    Hyperliquid market data from Ironflow's own nodes: tick-level fills and

    trades, candles, funding rates, liquidations, mark prices, open interest,

    markets and wallet analytics over REST. One schema across native HL perps,

    HIP-3 builder markets, HIP-4 outcome contracts and HL spot.


    **Base URL:** `https://api.ironflow.sh`


    **Authentication:** Read endpoints work without a key (keyless access) or

    with a Bearer token in the `Authorization` header. Writes always need a key.

    ```

    Authorization: Bearer if_your_api_key

    ```

    Get a free key at https://ironflow.sh/key.


    **Access levels:**


    | Access | Requests per minute | History | Max range per request |

    |---|---|---|---|

    | No key | 10 per IP | 24 hours | 1 hour |

    | Free key | 60 | 30 days | 6 hours |

    | Explorer | 100 | 90 days | 24 hours |

    | Builder | 1,000 | 1 year | 7 days |

    | Enterprise | 10,000 | full | unlimited |


    Without a market filter, high-volume endpoints allow at most 4 hours per
    request.

    `/v1/trades` filtered to one perp or spot market allows 24 hours per request

    without a key and on a free key.

    A header that is present but malformed returns 401; keyless access applies
    only

    when no `Authorization` header is sent.


    **Data availability:** fills and trades cover a rolling 12 months; other

    datasets start later (funding 2025-09-27, open interest and mark prices

    2026-04-29).


    **Timestamps:** All timestamps are Unix milliseconds (int64).


    **Pagination:** Paginated endpoints return a `cursor` in
    `pagination.next_cursor`.

    Pass it as the `cursor` query parameter to fetch the next page.

    When `pagination.has_more` is `false`, you have reached the last page.
  contact:
    name: Ironflow Support
    url: https://ironflow.sh
servers:
  - url: https://api.ironflow.sh
    description: Production
security:
  - bearerAuth: []
  - {}
tags:
  - name: Market Data
    description: Historical tick-level market data stored in ClickHouse.
  - name: Analytics
    description: >-
      Aggregated analytics. Net flows and funding stats work without a key; the
      others need a key (a free key works).
  - name: Cohorts
    description: Predefined and custom address groups for filtering market data.
  - name: Alerts
    description: >-
      Liquidation alerts that Ironflow posts to your webhook, Discord channel,
      Slack channel or Telegram chat.
  - name: Info Proxy
    description: >-
      Cached passthrough to the Hyperliquid Info API. No record caps, higher
      rate limits.
  - name: Export
    description: Bulk data export as CSV or Parquet (Builder tier and above).
  - name: Query
    description: >-
      Read-only ClickHouse SQL over curated Hyperliquid tables (hl.*), limited
      by tier.
  - name: System
    description: Health checks and metadata endpoints.
  - name: TradingApp
    description: >-
      Trading app Phase A — wallet auth (SIWE), agent-key provisioning, and
      kill-switch.
paths:
  /v1/book:
    get:
      tags:
        - Market Data
      summary: Live L2 order book of one market
      description: |
        The live L2 order book of one Hyperliquid market: up to 20 price
        levels a side with size and order count, best bid and ask, mid,
        spread in basis points and the USD depth returned on each side.
        Served from Hyperliquid's l2Book, cached up to one second per
        market; a book up to 10 s old is returned with `stale: true` when
        Hyperliquid cannot be reached. Perps, spot, HIP-3 and HIP-4
        markets. No key needed.
      operationId: getOrderBook
      parameters:
        - name: market
          in: query
          required: true
          description: >-
            Market symbol (BTC-PERP, xyz:NVDA-PERP, HYPE/USDC) or Hyperliquid
            coin name (BTC, @107).
          schema:
            type: string
        - name: depth
          in: query
          description: Levels a side, 1 to 20.
          schema:
            type: integer
            minimum: 1
            maximum: 20
            default: 20
        - name: sig_figs
          in: query
          description: >-
            Aggregate prices to 2 to 5 significant figures (coarser levels,
            deeper book). Leave out for full precision.
          schema:
            type: integer
            minimum: 2
            maximum: 5
      responses:
        '200':
          description: The order book.
          content:
            application/json:
              schema:
                type: object
                properties:
                  market:
                    type: string
                    example: BTC-PERP
                  coin:
                    type: string
                    example: BTC
                  time:
                    type: integer
                    format: int64
                    description: Book time, Unix ms
                  bids:
                    type: array
                    items:
                      type: object
                      properties:
                        price:
                          type: string
                        size:
                          type: string
                        orders:
                          type: integer
                  asks:
                    type: array
                    items:
                      type: object
                      properties:
                        price:
                          type: string
                        size:
                          type: string
                        orders:
                          type: integer
                  best_bid:
                    type: string
                  best_ask:
                    type: string
                  mid:
                    type: number
                  spread_bps:
                    type: number
                  bid_depth_usd:
                    type: number
                  ask_depth_usd:
                    type: number
                  source:
                    type: string
                  stale:
                    type: boolean
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          description: Unknown market.
        '503':
          description: Hyperliquid could not be reached; retry after a few seconds.
components:
  responses:
    BadRequest:
      description: Invalid request parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: BAD_REQUEST
              message: address is required
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Machine-readable error code.
              example: RATE_LIMIT_EXCEEDED
            message:
              type: string
              description: Human-readable error description.
              example: Rate limit exceeded. Retry after 60 seconds.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Ironflow API key, format `if_xxxx`. Free keys at
        https://ironflow.sh/key. Optional on read endpoints.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.