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

# fetch_orderbooks_batch

> Fetch full-depth L2 orderbooks for multiple assets in one round-trip.

Fetch full-depth L2 orderbooks for multiple assets in one round-trip.


## OpenAPI

````yaml openpx.openapi.yaml GET /v1/orderbook/fetch_orderbooks_batch
openapi: 3.1.0
info:
  title: OpenPX Unified API
  description: >-
    Unified API surface across prediction-market exchanges. One `Exchange`
    trait, one set of models, one shape — implemented in Rust with
    auto-generated Python and TypeScript SDKs.


    This OpenAPI spec is **auto-generated** from
    `engine/core/src/exchange/traits.rs` and `schema/openpx.schema.json`. Edit
    the trait or the schema, then regenerate via `just openapi`. The spec models
    trait methods as REST operations for documentation rendering only — OpenPX
    is an in-process Rust library, not a REST service.
  version: 0.3.1
  license:
    name: MIT
servers:
  - url: https://github.com/openpx-trade/openpx
    description: >-
      Documentation surface only. OpenPX is an in-process Rust library; there is
      no hosted REST endpoint.
security: []
tags:
  - name: Markets
  - name: Orders
  - name: Positions
  - name: Balance
  - name: Orderbook
  - name: Trades
  - name: Fills
  - name: Server
paths:
  /v1/orderbook/fetch_orderbooks_batch:
    get:
      tags:
        - Orderbook
      summary: Fetch orderbooks batch
      description: Fetch full-depth L2 orderbooks for multiple assets in one round-trip.
      operationId: fetch_orderbooks_batch
      parameters:
        - name: asset_ids
          in: query
          required: true
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Orderbook'
        default:
          description: Unified error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenPxError'
components:
  schemas:
    Orderbook:
      description: Full-depth L2 orderbook for one asset.
      properties:
        asks:
          description: Ask levels, sorted ascending by price.
          items:
            $ref: '#/components/schemas/PriceLevel'
          type: array
        asset_id:
          description: >-
            The orderable asset — Kalshi market ticker or Polymarket CTF token
            id (e.g. `"KXBTCD-25APR1517"`).
          type: string
        bids:
          description: Bid levels, sorted descending by price.
          items:
            $ref: '#/components/schemas/PriceLevel'
          type: array
        hash:
          description: Polymarket book-state hash for replay integrity; `null` on Kalshi.
          type:
            - string
            - 'null'
        last_update_id:
          description: Monotonic sequence id from upstream; `null` when not provided.
          format: uint64
          minimum: 0
          type:
            - integer
            - 'null'
        timestamp:
          description: Upstream snapshot time in UTC (e.g. `"2026-04-25T12:00:00Z"`).
          format: date-time
          type:
            - string
            - 'null'
      required:
        - asks
        - asset_id
        - bids
      type: object
    OpenPxError:
      type: object
      description: >-
        Unified error type returned when an exchange call fails. The `kind`
        field is the canonical category; `message` carries the upstream
        explanation. Per-exchange variants are mapped into this shape before
        they cross the trait boundary.
      required:
        - kind
        - message
      properties:
        kind:
          type: string
          enum:
            - Authentication
            - InsufficientFunds
            - MarketNotFound
            - OrderNotFound
            - RateLimited
            - NetworkError
            - Api
            - Config
            - NotSupported
        message:
          type: string
    PriceLevel:
      description: A single resting orderbook level.
      properties:
        price:
          allOf:
            - $ref: '#/components/schemas/number'
          description: Price as YES probability in `[0, 1]` (e.g. `0.62`).
        size:
          description: Resting size at this price in contracts (e.g. `100.0`).
          format: double
          type: number
      required:
        - price
        - size
      type: object
    number:
      format: double
      type: number

````