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

# Get market orderbook

> Fetch real-time orderbook (bids and asks) for a market. Supports Polymarket, Kalshi, Limitless, and Manifold.



## OpenAPI

````yaml openapi.json get /markets/{id}/orderbook
openapi: 3.1.0
info:
  title: Polyrouter API
  version: 2.0.0
  description: >-
    Unified API for prediction market platforms (Polymarket, Kalshi, Limitless,
    Manifold)
  contact:
    name: Polyrouter
    url: https://polyrouter.io
servers:
  - url: https://api-v2.polyrouter.io
    description: Production
security:
  - apiKey: []
tags:
  - name: Health
    description: Health check and API info
  - name: Markets
    description: Prediction market operations
  - name: Events
    description: Event operations
  - name: Series
    description: Series operations
  - name: Platforms
    description: Platform information
  - name: Search
    description: Search across platforms
  - name: Trades
    description: Historical trades data
  - name: Orderbook
    description: Orderbook data (real-time and historical)
  - name: Sports
    description: Sports betting markets - games, awards, futures, and league info
  - name: Profile
    description: User profiles, trading metrics, and trade history
paths:
  /markets/{id}/orderbook:
    get:
      tags:
        - Markets
      summary: Get market orderbook
      description: >-
        Fetch real-time orderbook (bids and asks) for a market. Supports
        Polymarket, Kalshi, Limitless, and Manifold.
      operationId: getMarketOrderbook
      parameters:
        - schema:
            type: string
            example: KXELONMARS-99
          required: true
          name: id
          in: path
        - schema:
            type: string
            enum:
              - polymarket
              - kalshi
              - limitless
              - manifold
            description: >-
              Specify platform to fetch orderbook from. If not specified,
              auto-detects from market ID
          required: false
          name: platform
          in: query
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            description: Include raw platform response data in metadata._raw
          required: false
          name: include_raw
          in: query
      responses:
        '200':
          description: Orderbook data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderbookResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Orderbook not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - apiKey: []
components:
  schemas:
    OrderbookResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/OrderbookData'
        meta:
          type: object
          properties:
            request_time:
              type: number
              example: 150
          required:
            - request_time
      required:
        - data
        - meta
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              example: NOT_FOUND
            message:
              type: string
              example: Resource not found
            timestamp:
              type: string
              format: date-time
              example: '2025-01-01T00:00:00.000Z'
          required:
            - code
            - message
            - timestamp
      required:
        - error
    OrderbookData:
      type: object
      properties:
        market_id:
          type: string
          example: '524153'
        platform:
          type: string
          example: polymarket
        timestamp:
          type: string
          example: '2025-01-01T00:00:00.000Z'
        'yes':
          $ref: '#/components/schemas/OrderbookSide'
        'no':
          $ref: '#/components/schemas/OrderbookSide'
        metadata:
          type: object
          properties:
            min_order_size:
              type: number
              example: 5
            tick_size:
              type: number
              example: 0.001
            neg_risk:
              type: boolean
              example: false
      required:
        - market_id
        - platform
        - timestamp
        - 'yes'
        - 'no'
    OrderbookSide:
      type: object
      properties:
        bids:
          type: array
          items:
            $ref: '#/components/schemas/OrderbookOrder'
        asks:
          type: array
          items:
            $ref: '#/components/schemas/OrderbookOrder'
        depth:
          type: number
          example: 50000
      required:
        - bids
        - asks
    OrderbookOrder:
      type: object
      properties:
        price:
          type: number
          example: 0.65
        size:
          type: number
          example: 1000
      required:
        - price
        - size
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication

````