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

# Orderbook History

> Get historical orderbook snapshots for a token

Fetch historical orderbook snapshots for a token. Data starts from **January 1st, 2026**.

<Tip>**Free & Unlimited.** This endpoint does not count toward your monthly usage limits on any plan.</Tip>

| Constraint | Value               |
| ---------- | ------------------- |
| `limit`    | 1–200 (default 100) |

<Warning>Timestamps are in **milliseconds** for this endpoint.</Warning>


## OpenAPI

````yaml GET /v2/polymarket/orderbooks
openapi: 3.1.0
info:
  title: Predexon API
  description: Prediction market data aggregation and matching API
  version: 2.0.0
servers:
  - url: https://api.predexon.com
security:
  - apiKey: []
paths:
  /v2/polymarket/orderbooks:
    get:
      tags:
        - polymarket
      summary: Get Orderbooks
      description: >-
        Fetch historical orderbook snapshots for a specific asset (token ID)
        over a specified time range.


        Returns snapshots of the order book including bids, asks, and market
        metadata in order.

        All timestamps are in milliseconds. Orderbook data has history starting
        from January 1st, 2026.
      operationId: get_orderbooks_v2_polymarket_orderbooks_get
      parameters:
        - name: token_id
          in: query
          required: true
          schema:
            type: string
            description: The token ID (asset) for the Polymarket market
            title: Token Id
          description: The token ID (asset) for the Polymarket market
        - name: start_time
          in: query
          required: true
          schema:
            type: integer
            description: Start time in Unix timestamp (milliseconds)
            title: Start Time
          description: Start time in Unix timestamp (milliseconds)
        - name: end_time
          in: query
          required: true
          schema:
            type: integer
            description: End time in Unix timestamp (milliseconds)
            title: End Time
          description: End time in Unix timestamp (milliseconds)
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            description: Maximum number of snapshots to return
            default: 100
            title: Limit
          description: Maximum number of snapshots to return
        - name: pagination_key
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Pagination key to get the next chunk of data
            title: Pagination Key
          description: Pagination key to get the next chunk of data
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderbooksResponse'
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
components:
  schemas:
    OrderbooksResponse:
      properties:
        snapshots:
          items:
            $ref: '#/components/schemas/OrderbookSnapshot'
          type: array
          title: Snapshots
        pagination:
          $ref: '#/components/schemas/CursorPagination'
      type: object
      required:
        - snapshots
        - pagination
      title: OrderbooksResponse
      description: Orderbooks endpoint response.
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
        message:
          type: string
          title: Message
      type: object
      required:
        - error
        - message
      title: ErrorResponse
      description: Standard error response.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    OrderbookSnapshot:
      properties:
        asks:
          items:
            $ref: '#/components/schemas/OrderbookLevel'
          type: array
          title: Asks
          description: Ask price levels, ordered by price
        bids:
          items:
            $ref: '#/components/schemas/OrderbookLevel'
          type: array
          title: Bids
          description: Bid price levels, ordered by price
        hash:
          type: string
          title: Hash
          description: Orderbook state hash
        assetId:
          type: string
          title: Assetid
          description: Asset/token ID
        timestamp:
          type: integer
          title: Timestamp
          description: Snapshot timestamp (Unix epoch MILLISECONDS)
        tickSize:
          type: string
          title: Ticksize
          description: Tick size for price levels
        indexedAt:
          type: integer
          title: Indexedat
          description: When snapshot was indexed (Unix epoch MILLISECONDS)
        market:
          type: string
          title: Market
          description: Market condition ID / address
      type: object
      required:
        - asks
        - bids
        - hash
        - assetId
        - timestamp
        - tickSize
        - indexedAt
        - market
      title: OrderbookSnapshot
      description: |-
        Single orderbook snapshot.

        Note: This model uses MILLISECONDS for timestamps (not seconds) to match
        the source data format from the orderbook indexer.
    CursorPagination:
      properties:
        limit:
          type: integer
          title: Limit
          description: Requested limit
        count:
          type: integer
          title: Count
          description: Number of items in current response
        pagination_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Pagination Key
          description: Base64-encoded cursor for next page
        has_more:
          type: boolean
          title: Has More
          description: Whether there are more items available
      type: object
      required:
        - limit
        - count
        - has_more
      title: CursorPagination
      description: Cursor-based pagination for endpoints that don't support offset.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    OrderbookLevel:
      properties:
        size:
          type: number
          title: Size
          description: Size at this price level
        price:
          type: number
          title: Price
          description: Price level (0-1 range)
      type: object
      required:
        - size
        - price
      title: OrderbookLevel
      description: Single price level in orderbook.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````