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

# Get order books

> Get a level-2 bid/ask snapshot for selected Rook listing_ids. Set depth to request the maximum returned price levels per side; quantities are for the listing's selected outcome and stated quantity unit.

Each result identifies its book revision, source/receipt times, returned depth and whether more depth exists. Cumulative size/notional and derived prices refer to that same revision and actual returned levels. Empty, one-sided, crossed, stale and unavailable books have distinct states. Use these snapshots to inspect liquidity; they do not reserve size or place orders.

See the [integration guide](/guides/market-data) for the workflow and interpretation of this response.


## OpenAPI

````yaml GET /orderbooks
openapi: 3.1.0
info:
  title: Rook API
  version: 0.1.0-design
  description: Markets, settlement relationships, scenarios, payouts and market data.
servers:
  - url: https://api.rook.pm/v1
    description: Proposed API origin; not an assertion these operations are callable.
security:
  - ApiKeyBearer: []
tags:
  - name: Reference data
    description: Events, unified markets and native-ID resolution.
  - name: Families and scenarios
    description: Family scope and versioned scenario columns.
  - name: Relationships and Combos
    description: Related-market discovery, selected-set inference and Combo interpretation.
  - name: Payouts and exposure
    description: Scoped per-unit payouts and stateless portfolio/candidate calculations.
  - name: Market data
    description: Current prices, history, L2 books, prints, statistics and published fees.
  - name: Fair values
    description: Future private customer estimates; not Rook forecasts.
  - name: Coverage and updates
    description: Supported capabilities and incremental semantic changes.
paths:
  /orderbooks:
    get:
      tags:
        - Market data
      summary: Get order books
      description: >-
        Get a level-2 bid/ask snapshot for selected Rook listing_ids. Set depth
        to request the maximum returned price levels per side; quantities are
        for the listing's selected outcome and stated quantity unit.


        Each result identifies its book revision, source/receipt times, returned
        depth and whether more depth exists. Cumulative size/notional and
        derived prices refer to that same revision and actual returned levels.
        Empty, one-sided, crossed, stale and unavailable books have distinct
        states. Use these snapshots to inspect liquidity; they do not reserve
        size or place orders.
      operationId: getOrderBooks
      parameters:
        - name: listing_ids
          in: query
          required: true
          description: >-
            Rook listing IDs from /markets or /markets:resolve. Select the venue
            and outcome side explicitly; repeat the query parameter for multiple
            listings.
          schema:
            type: array
            items:
              type: string
              description: Opaque text identifier. Preserve its exact value.
              minLength: 1
            minItems: 1
          style: form
          explode: true
          example:
            - lst_pm_fed_dec_2026_cut_yes
        - name: depth
          in: query
          required: false
          description: >-
            Maximum price levels requested per book side. Results disclose
            actual returned depth and whether more levels exist.
          schema:
            type: integer
            minimum: 1
            default: 10
          example: 2
        - name: X-Client-Request-Id
          in: header
          required: false
          schema:
            type: string
          description: Caller correlation reference; not an idempotency guarantee.
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrderBooksResponse'
              example:
                items:
                  - listing_id: lst_pm_fed_dec_2026_cut_yes
                    venue: polymarket
                    status: LIVE
                    quote_currency: USDC
                    quantity_unit: shares
                    snapshot_id: book_snapshot_1842
                    book_revision: book_1842
                    bids:
                      - price: '0.40'
                        quantity: '1200'
                        cumulative_quantity: '1200'
                        cumulative_notional: '480'
                      - price: '0.39'
                        quantity: '800'
                        cumulative_quantity: '2000'
                        cumulative_notional: '792'
                    asks:
                      - price: '0.42'
                        quantity: '900'
                        cumulative_quantity: '900'
                        cumulative_notional: '378'
                      - price: '0.43'
                        quantity: '600'
                        cumulative_quantity: '1500'
                        cumulative_notional: '636'
                    returned_depth: 2
                    has_more_depth: true
                    depth_scope: Top 2 levels per side; cumulative notional excludes fees.
                    best_bid:
                      price: '0.40'
                      quantity: '1200'
                    best_ask:
                      price: '0.42'
                      quantity: '900'
                    times:
                      source_timestamp: '2026-10-19T11:59:59.800Z'
                      received_at: '2026-10-19T11:59:59.910Z'
                      published_at: '2026-10-19T12:00:00Z'
                next_page_token: null
                snapshot_id: snap_rates_20261019_120000
                as_of: '2026-10-19T12:00:00Z'
          headers:
            X-Request-Id:
              description: Server request trace ID.
              schema:
                type: string
                description: Opaque text identifier. Preserve its exact value.
                minLength: 1
components:
  schemas:
    GetOrderBooksResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/OrderBook'
        next_page_token:
          type: 'null'
          description: >-
            All requested IDs are accounted for in one bounded batch; no silent
            truncation.
        snapshot_id:
          type: string
          description: Opaque text identifier. Preserve its exact value.
          minLength: 1
        as_of:
          type: string
          format: date-time
      required:
        - items
        - next_page_token
        - snapshot_id
        - as_of
      additionalProperties: true
    OrderBook:
      type: object
      properties:
        listing_id:
          type: string
          minLength: 1
          description: >-
            Rook ID for one outcome listing on one venue; preserves venue
            provenance.
        venue:
          type: string
        status:
          type: string
          enum:
            - LIVE
            - STALE
            - EMPTY
            - UNAVAILABLE
        quote_currency:
          type: string
        quantity_unit:
          type: string
        snapshot_id:
          anyOf:
            - type: string
              description: Opaque text identifier. Preserve its exact value.
              minLength: 1
            - type: 'null'
        book_revision:
          anyOf:
            - type: string
              description: Opaque text identifier. Preserve its exact value.
              minLength: 1
            - type: 'null'
        bids:
          type: array
          items:
            $ref: '#/components/schemas/Level'
        asks:
          type: array
          items:
            $ref: '#/components/schemas/Level'
        returned_depth:
          type: integer
          minimum: 0
        has_more_depth:
          type: boolean
        depth_scope:
          type: string
        times:
          $ref: '#/components/schemas/DataTimes'
        reason:
          anyOf:
            - type: string
            - type: 'null'
        best_bid:
          anyOf:
            - $ref: '#/components/schemas/Level'
            - type: 'null'
        best_ask:
          anyOf:
            - $ref: '#/components/schemas/Level'
            - type: 'null'
      required:
        - listing_id
        - status
        - bids
        - asks
        - returned_depth
        - has_more_depth
        - depth_scope
        - times
      additionalProperties: true
    Level:
      type: object
      properties:
        price:
          $ref: '#/components/schemas/Decimal'
        quantity:
          $ref: '#/components/schemas/Decimal'
        cumulative_quantity:
          $ref: '#/components/schemas/Decimal'
        cumulative_notional:
          $ref: '#/components/schemas/Decimal'
      required:
        - price
        - quantity
      additionalProperties: true
    DataTimes:
      type: object
      properties:
        source_timestamp:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        received_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        published_at:
          type: string
          format: date-time
      required:
        - source_timestamp
        - received_at
        - published_at
      additionalProperties: true
    Decimal:
      type: string
      description: >-
        Exact base-10 value encoded as a string; no exponent or non-finite
        values.
      pattern: ^-?(0|[1-9][0-9]*)(\.[0-9]+)?$
  securitySchemes:
    ApiKeyBearer:
      type: http
      scheme: bearer
      description: >-
        Proposed server-to-server API key. No client request HMAC signing scheme
        is specified.

````

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