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

# Get market order book

> Returns the current order book (bids and asks) for a specific market. Includes depth information for both Yes and No outcomes.



## OpenAPI

````yaml GET /v1/api/markets/id/{id}/orderbook
openapi: 3.1.0
info:
  title: Dot Prediction API
  description: >-
    A unified API for accessing prediction market data across Kalshi,
    Polymarket, and Limitless.
  version: 1.0.0
servers:
  - url: https://api.dotprediction.io
security:
  - apiKey: []
paths:
  /v1/api/markets/id/{id}/orderbook:
    get:
      tags:
        - Markets
      summary: Get market order book
      description: >-
        Returns the current order book (bids and asks) for a specific market.
        Includes depth information for both Yes and No outcomes.
      operationId: getMarketOrderbook
      parameters:
        - name: id
          in: path
          required: true
          description: The market ID.
          schema:
            type: string
        - name: provider
          in: query
          required: true
          description: The prediction market platform to query.
          schema:
            type: string
            enum:
              - kalshi
              - polymarket
              - limitless
        - name: include_raw
          in: query
          required: false
          description: Include the raw provider response.
          schema:
            type: string
            enum:
              - 'true'
              - 'false'
      responses:
        '200':
          description: Market order book data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketOrderBookResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    MarketOrderBookResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            market_id:
              type: string
              description: Market identifier.
            platform:
              type: string
              description: Source platform.
            timestamp:
              type: string
              description: Snapshot timestamp.
            'yes':
              $ref: '#/components/schemas/OrderBookSide'
              description: Order book for the Yes outcome.
            'no':
              $ref: '#/components/schemas/OrderBookSide'
              description: Order book for the No outcome.
            metadata:
              type: object
              properties:
                min_order_size:
                  type: number
                tick_size:
                  type: number
                neg_risk:
                  type: boolean
        meta:
          type: object
          properties:
            request_time:
              type: integer
    OrderBookSide:
      type: object
      properties:
        bids:
          type: array
          items:
            $ref: '#/components/schemas/OrderBookLevel'
          description: Buy orders.
        asks:
          type: array
          items:
            $ref: '#/components/schemas/OrderBookLevel'
          description: Sell orders.
        depth:
          type: number
          description: Total depth of the order book side.
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            status:
              type: integer
              description: HTTP status code.
            message:
              type: string
              description: Human-readable error message.
            resolution:
              type: string
              description: Suggested action to resolve the error.
            error_text:
              type: string
              description: Detailed error information.
    OrderBookLevel:
      type: object
      properties:
        price:
          type: number
          description: Price level.
        size:
          type: number
          description: Size (quantity) at this price level.
  responses:
    BadRequest:
      description: Invalid request parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: Rate limit exceeded. Check the `Retry-After` header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key for authentication. Generate one via the dashboard or the
        `/v1/api/auth/api-keys` endpoint.

````