Skip to main content
GET
/
polymarket
/
orderbooks
Get Orderbook History
curl --request GET \
  --url https://api.aisa.one/apis/v1/polymarket/orderbooks \
  --header 'Authorization: Bearer <token>'
{
  "snapshots": [
    {
      "asks": [
        {
          "size": "5000013.15",
          "price": "0.999"
        }
      ],
      "bids": [
        {
          "size": "438389.53",
          "price": "0.001"
        }
      ],
      "hash": "85c493ebeea97e2f70c85a1469aede05f892408f",
      "minOrderSize": "5",
      "negRisk": true,
      "assetId": "56369772478534954338683665819559528414197495274302917800610633957542171787417",
      "timestamp": 1760471849407,
      "tickSize": "0.001",
      "indexedAt": 1760471852863,
      "market": "0xd10bc768ede58b53ed400594240b0a0603134a32dab89ec823a18759cbc180ca"
    }
  ],
  "pagination": {
    "limit": 100,
    "count": 4,
    "pagination_key": "eyJhc3NldElkIjoiMTM1ODUxMjc2NDY0NTMxMDM0ODcyMjY1MTg3ODYyNjk5NjE0MDAyMjI5NzA0NzI3MzgxMTIwOTU1NDY0MDc5MTY4NDcxMTIyNzE2NjQiLCJ0aW1lc3RhbXAiOjE3NjExMDQwOTg5MTR9",
    "has_more": false
  }
}
Orderbook History fetches historical orderbook snapshots for a specific Polymarket asset (token ID) over a specified time range. If no start and end times are provided, it returns the latest orderbook snapshot for the market. Returns snapshots of the order book including bids, asks, and market metadata. Best for: Analyzing market depth, tracking bid/ask spread over time, building orderbook visualizations, monitoring liquidity. Endpoint: GET /polymarket/orderbooks
Note: All timestamps are in milliseconds. Orderbook data has history starting from October 14th, 2025. When fetching the latest orderbook (without start/end times), the limit and pagination_key parameters are ignored.

Example

curl -X GET "https://api.aisa.one/apis/v1/polymarket/orderbooks?token_id=56369772478534954338683665819559528414197495274302917800610633957542171787417&start_time=1760470000000&end_time=1760480000000&limit=100" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response

The response returns a snapshots array containing orderbook snapshot objects, each with bids and asks arrays (containing size and price), along with metadata such as asset ID, timestamp, tick size, and market condition ID. A pagination object with has_more and pagination_key fields supports cursor-based pagination.

Authorizations

Authorization
string
header
required

Your AIsa API key as a Bearer token.

Query Parameters

token_id
string
required

The token id (asset) for the Polymarket market

Example:

"56369772478534954338683665819559528414197495274302917800610633957542171787417"

start_time
integer

Start time in Unix timestamp (milliseconds). Optional - if not provided along with end_time, returns the latest orderbook snapshot.

Example:

1760470000000

end_time
integer

End time in Unix timestamp (milliseconds). Optional - if not provided along with start_time, returns the latest orderbook snapshot.

Example:

1760480000000

limit
integer
default:100

Maximum number of snapshots to return (default: 100, max: 200). Ignored when fetching the latest orderbook without start_time and end_time.

Required range: x <= 200
Example:

100

pagination_key
string

Pagination key to get the next chunk of data. Ignored when fetching the latest orderbook without start_time and end_time.

Example:

"eyJhc3NldElkIjoiMTM1ODUxMjc2NDY0NTMxMDM0ODcyMjY1MTg3ODYyNjk5NjE0MDAyMjI5NzA0NzI3MzgxMTIwOTU1NDY0MDc5MTY4NDcxMTIyNzE2NjQiLCJ0aW1lc3RhbXAiOjE3NjExMDQwOTg5MTR9"

Response

Orderbook history response

snapshots
object[]

Array of orderbook snapshots at different points in time

pagination
object