---
title: "Get Predictfun Orderbooks"
method: GET
path: "/v2/predictfun/orderbooks"
tags: ["predictfun"]
---

# Get Predictfun Orderbooks

`GET /v2/predictfun/orderbooks`

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.

## Query parameters

- `market_id` integer, required — The PredictFun market ID
- `start_time` integer, required — Start time in Unix timestamp (milliseconds)
- `end_time` integer, required — End time in Unix timestamp (milliseconds)
- `limit` integer — Maximum number of snapshots to return
- `pagination_key` string, nullable — Pagination key to get the next chunk of data

## Response `200`

Successful Response

- PredictFunOrderbooksResponse — PredictFun orderbooks endpoint response.
  - `snapshots` PredictFunOrderbookSnapshot[], required
    - `market_id` integer, required — Market ID
    - `timestamp` integer, required — Snapshot timestamp (Unix epoch MILLISECONDS)
    - `bids` PredictFunOrderbookLevel[], required — Bid levels
      - `price` number, required — Price level (0-1 range)
      - `size` number, required — Size at this price level
    - `asks` PredictFunOrderbookLevel[], required — Ask levels
      - `price` number, required — Price level (0-1 range)
      - `size` number, required — Size at this price level
    - `best_bid` number, required — Best bid price
    - `best_ask` number, required — Best ask price
    - `bid_depth` number, required — Total bid depth
    - `ask_depth` number, required — Total ask depth
  - `pagination` CursorPagination, required — Cursor-based pagination for endpoints that don't support offset.
    - `limit` integer, required — Requested limit
    - `count` integer, required — Number of items in current response
    - `pagination_key` string, nullable — Base64-encoded cursor for next page
    - `has_more` boolean, required — Whether there are more items available

## Other responses

- `400` — Bad Request
- `422` — Validation Error
- `500` — Internal Server Error

---

[API](https://skmtc.net/predexon/apis/predexon-api.md) · [All operations](https://skmtc.net/predexon/apis/predexon-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/predexon/predexon-api/revisions/80a306fbdb39/schema)
