---
title: "Polymarket Orderbook History"
method: GET
path: "/gateway/v1/prediction-market/polymarket/orderbooks"
tags: ["Prediction Market"]
---

# Polymarket Orderbook History

`GET /gateway/v1/prediction-market/polymarket/orderbooks`

## Request

- Base URL: `https://api.asksurf.ai`
- URL: `https://api.asksurf.ai/gateway/v1/prediction-market/polymarket/orderbooks`
- Auth: HTTP bearer

Historical orderbook snapshots for a Polymarket token. Returns raw bid/ask depth levels. Timestamps in milliseconds.

Data refresh: ~5 minutes

## Query parameters

- `token_id` string, required: Token identifier
- `start_time` integer: Start time in Unix milliseconds. 0 means 7 days ago.
- `end_time` integer: End time in Unix milliseconds. 0 means current time.
- `limit` integer: Maximum number of snapshots to return
- `pagination_key` string: Base64 cursor for pagination

## Response `200`

OK

- V2OrderbooksResponse
  - `$schema` string, uri: A URL to the JSON Schema for this object.
  - `pagination` V2CursorPagination, required
    - `count` integer, required: Items in current response
    - `has_more` boolean, required: Whether more data is available
    - `limit` integer, required: Requested limit
    - `pagination_key` string: Base64 cursor for next page
  - `snapshots` V2OrderbookSnapshot[], nullable, required
    - `asks` V2OrderbookLevel[], nullable, required: Sell orders, price-ordered
      - `price` number, double, required: Price level (0-1)
      - `size` number, double, required: Quantity at this price level
    - `assetId` string, required: Token identifier
    - `bids` V2OrderbookLevel[], nullable, required: Buy orders, price-ordered
      - `price` number, double, required: Price level (0-1)
      - `size` number, double, required: Quantity at this price level
    - `hash` string, required: Orderbook state identifier
    - `indexedAt` integer, required: Indexing time in milliseconds
    - `market` string, required: Market condition ID
    - `tickSize` string, required: Minimum price increment
    - `timestamp` integer, required: Snapshot time in milliseconds

## Other responses

- `default`: Error

---

[API](https://skmtc.dev/asksurf/apis/asksurf-public-rest-api.md) - [All operations](https://skmtc.dev/asksurf/apis/asksurf-public-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/asksurf/apis/asksurf-public-rest-api/revisions/91774fdd5302?raw)
