> ## 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

> Fetch historical orderbook snapshots for a Predict.Fun market

Fetch historical orderbook snapshots for a Predict.Fun market. Data starts from **March 11th, 2026**.

YES-side orderbook only.

<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/predictfun/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/predictfun/orderbooks:
    get:
      tags:
        - predictfun
      summary: Get Predictfun Orderbooks
      description: >-
        Fetch historical orderbook snapshots for a PredictFun market over a
        specified time range.


        Returns orderbook snapshots including bids, asks, and depth metadata.

        All timestamps are in milliseconds.
      operationId: get_predictfun_orderbooks_v2_predictfun_orderbooks_get
      parameters:
        - name: market_id
          in: query
          required: true
          schema:
            type: integer
            description: The PredictFun market ID
            title: Market Id
          description: The PredictFun market ID
        - 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/PredictFunOrderbooksResponse'
        '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:
    PredictFunOrderbooksResponse:
      properties:
        snapshots:
          items:
            $ref: '#/components/schemas/PredictFunOrderbookSnapshot'
          type: array
          title: Snapshots
        pagination:
          $ref: '#/components/schemas/CursorPagination'
      type: object
      required:
        - snapshots
        - pagination
      title: PredictFunOrderbooksResponse
      description: PredictFun 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
    PredictFunOrderbookSnapshot:
      properties:
        market_id:
          type: integer
          title: Market Id
          description: Market ID
        timestamp:
          type: integer
          title: Timestamp
          description: Snapshot timestamp (Unix epoch MILLISECONDS)
        bids:
          items:
            $ref: '#/components/schemas/PredictFunOrderbookLevel'
          type: array
          title: Bids
          description: Bid levels
        asks:
          items:
            $ref: '#/components/schemas/PredictFunOrderbookLevel'
          type: array
          title: Asks
          description: Ask levels
        best_bid:
          type: number
          title: Best Bid
          description: Best bid price
        best_ask:
          type: number
          title: Best Ask
          description: Best ask price
        bid_depth:
          type: number
          title: Bid Depth
          description: Total bid depth
        ask_depth:
          type: number
          title: Ask Depth
          description: Total ask depth
      type: object
      required:
        - market_id
        - timestamp
        - bids
        - asks
        - best_bid
        - best_ask
        - bid_depth
        - ask_depth
      title: PredictFunOrderbookSnapshot
      description: Single PredictFun orderbook snapshot.
    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
    PredictFunOrderbookLevel:
      properties:
        price:
          type: number
          title: Price
          description: Price level (0-1 range)
        size:
          type: number
          title: Size
          description: Size at this price level
      type: object
      required:
        - price
        - size
      title: PredictFunOrderbookLevel
      description: Single price level in PredictFun orderbook.
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````