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

# Get Historical Orderbooks

> Fetch historical orderbook snapshots for a single market stream. This route is for stored historical orderbooks, not the live websocket feed. The response shape depends on `venue`: Polymarket returns Polymarket orderbook snapshots keyed by `token_id`, while Kalshi returns Kalshi orderbook snapshots keyed by `market_id` with separate `yes` and `no` books.



## OpenAPI

````yaml /openapi.json get /api/v1/markets/orderbooks/historical
openapi: 3.1.0
info:
  title: Synthesis API
  version: 1.0.0
  description: Unified prediction market API for Polymarket and Kalshi.
servers:
  - url: https://synthesis.trade
security: []
tags:
  - name: Projects
    description: Create and manage project accounts, sessions, and account API keys.
  - name: Accounts
    description: >-
      Authenticate and manage account-level sessions, account API keys, and
      public account preferences.
  - name: Markets
    description: Unified market discovery and analytics across Polymarket and Kalshi.
  - name: Polymarket
    description: Polymarket market data, prices, orderbooks, trades, and holders endpoints.
  - name: Kalshi
    description: Kalshi market data, events, history, leaderboard, and profile endpoints.
  - name: Wallets
    description: Wallet management routes. Each wallet supports multiple chains.
  - name: Polygon
    description: >-
      Polygon wallet routes for balances, orders, minting, redemption,
      withdrawals, and swaps.
  - name: Polygon Copytrades
    description: Polymarket copytrade configuration and management for Polygon wallets.
  - name: Solana
    description: >-
      Solana wallet routes used for Kalshi balances, KYC, orders, redemption,
      and withdrawals.
  - name: News
    description: News endpoints with market and event matching.
  - name: WebSockets
    description: >-
      Real-time streaming endpoints for orderbooks, trades, balances, and live
      data feeds.
paths:
  /api/v1/markets/orderbooks/historical:
    get:
      tags:
        - Markets
      summary: Get Historical Orderbooks
      description: >-
        Fetch historical orderbook snapshots for a single market stream. This
        route is for stored historical orderbooks, not the live websocket feed.
        The response shape depends on `venue`: Polymarket returns Polymarket
        orderbook snapshots keyed by `token_id`, while Kalshi returns Kalshi
        orderbook snapshots keyed by `market_id` with separate `yes` and `no`
        books.
      operationId: get-market-historical-orderbooks
      parameters:
        - name: venue
          in: query
          required: true
          description: >-
            Venue selector. Required. Supported values: `polymarket` or
            `kalshi`.
          schema:
            type: string
            example: polymarket
        - name: token_id
          in: query
          required: false
          description: >-
            Required when `venue=polymarket`. Polymarket token ID whose
            historical orderbook snapshots should be returned. Missing or empty
            values are rejected for Polymarket requests.
          schema:
            type: string
            example: >-
              21742633143463906290569050155826241533067272736897614950488156847949938836455
        - name: market_id
          in: query
          required: false
          description: >-
            Required when `venue=kalshi`. Kalshi market ID whose historical
            orderbook snapshots should be returned. Missing or empty values are
            rejected for Kalshi requests.
          schema:
            type: string
            example: KXBTC-25-T100000
        - name: start
          in: query
          required: false
          description: >-
            Range start. Accepts Unix seconds, Unix milliseconds, or an RFC 3339
            timestamp. If omitted, the earliest stored snapshot for the
            requested `token_id` or `market_id` is used.
          schema:
            type: string
            example: '2026-01-01T00:00:00'
        - name: end
          in: query
          required: false
          description: >-
            Range end. Accepts Unix seconds, Unix milliseconds, or an RFC 3339
            timestamp. If omitted, the latest stored snapshot for the requested
            `token_id` or `market_id` is used.
          schema:
            type: string
            example: '1735776000000'
        - name: order
          in: query
          required: false
          description: >-
            Sort order for returned snapshots. Supported values: `ASC` or
            `DESC`.
          schema:
            type: string
            default: DESC
            example: ASC
        - name: limit
          in: query
          required: false
          description: >-
            Maximum snapshots to return. Must be greater than `0`. Capped at
            `25000`.
          schema:
            type: integer
            default: 1000
            example: 500
        - name: offset
          in: query
          required: false
          description: Pagination offset. Must be `0` or greater.
          schema:
            type: integer
            default: 0
            example: 0
        - name: bucket
          in: query
          required: false
          description: >-
            Optional time bucket used to downsample snapshots. Format is a
            positive integer plus optional unit: seconds by default, or explicit
            `s`, `m`, `h`, `d`. Examples: `30`, `30s`, `5m`, `1h`, `1d`. The
            effective bucket is clamped to between `1` second and `1` day.
          schema:
            type: string
            example: 5m
        - name: points
          in: query
          required: false
          description: >-
            Optional target point count used only when `bucket` is omitted. An
            automatic bucket size is derived from the requested time range, and
            `points` is capped at `25000`.
          schema:
            type: integer
            example: 200
      responses:
        '200':
          description: Historical orderbook snapshots
          content:
            application/json:
              example:
                success: true
                response:
                  - condition_id: >-
                      0xbd71b43bb47eb60dbcb41fa25df2a0ed4da612873d6e0447a2c730bd4cc25910
                    token_id: >-
                      21742633143463906290569050155826241533067272736897614950488156847949938836455
                    bids:
                      '0.61': '1000'
                      '0.60': '800'
                    asks:
                      '0.62': '900'
                      '0.63': '600'
                    best_bid: '0.61'
                    best_ask: '0.62'
                    hash: ''
                    created_at: '2026-01-01T00:00:00'
        '400':
          description: Invalid query parameters
          content:
            application/json:
              example:
                success: false
                response: Invalid venue
      security: []

````