Pagination
Walk long lists page by page with cursors, by hand or with the SDKs.
Endpoints that can return long lists answer one page at a time. Each page ends
with a next_cursor; send it back as cursor to get the next page. The cursor
is opaque, so don't try to read or build one.
Endpoints that paginate
| Endpoint | Default limit | Max limit |
|---|---|---|
GET /v1/matching-markets/sports | 25 | 100 |
GET /v1/markets | 25 | 100 |
GET /v1/polymarket/wallet/positions | 50 | 100 |
GET /v1/crypto-prices/binance | 100 | 100 |
A few details:
- Wallet positions keep the page size of the first page on every later page, because it travels in the cursor.
- Crypto prices are per second, newest first. With no
start_time,end_timeorcursor, the route answers the single latest price and no next page. Its oldpagination_keyparameter is a400that namescursor. GET /v1/matching-markets/sports/lookupdoesn't paginate. It answers at most 100 IDs in one response, with nopaginationblock,limitorcursor.
Response shape
Every paginated response carries its items in data, in page order, and a pagination block that is always the same:
{
"pagination": {
"limit": 25,
"total": 143,
"has_more": true,
"next_cursor": "eyJzIjoiYWJjMTIzZWYi..."
}
}| Field | Description |
|---|---|
limit | Page size used for this response. Wallet positions cursors preserve the first page's size; other endpoints echo the limit query param (or the default). Crypto prices report 1 when you send no time range. |
total | Total matching items across all pages, or null when the route cannot count them: wallet positions and crypto prices, whose upstreams give no total. 0 only ever means an empty result. Use has_more and next_cursor whatever total says. |
has_more | true when more pages exist beyond this one. |
next_cursor | Pass back via the cursor query param for the next page. Absent when has_more is false. |
Walking every page
The SDKs walk the cursor for you. A call to one of the four paginated operations returns a page (TypeScript and Go) or a pager (Python); iterating it visits every item on every page, sends each next cursor, and repeats the filters that issued it. With cURL you follow next_cursor yourself.
# Page 1
curl -H "Authorization: Bearer $API_KEY" \
"https://api.predictorsdk.com/v1/matching-markets/sports?limit=25"
# Page 2 (use next_cursor from page 1's response)
curl -H "Authorization: Bearer $API_KEY" \
"https://api.predictorsdk.com/v1/matching-markets/sports?limit=25&cursor=eyJzIjoi..."Iterating walks every page, so to read only the first, use page.data (TypeScript), pager.items (Python) or page.Results (Go). A manual cursor is still accepted, to resume a walk you saved; send it with the same filters.
Important rules
Keep request shape constant across pages
The cursor is scoped to the request shape it was issued with. If you change include_settled, provider, category, or any other supported filter mid-traversal, you'll get a 400:
{
"code": "invalid_cursor",
"message": "pagination cursor does not match the current filters; a cursor continues the provider and category values that issued it, on /v1/markets only",
"status_code": 400,
"param": "cursor"
}On matching-markets the message also quotes the cursor and names the
parameters it binds (include_settled, include_submarkets,
player_prop_match, league, scheduled_date and participant).
Drop the cursor and start fresh from page 1 whenever filters change.
Wallet positions cursors preserve the page size
For GET /v1/polymarket/wallet/positions, choose limit on the first page.
When following next_cursor, omit limit or keep it the same: a different
valid limit does not change the cursor's page size, and pagination.limit
reports the size actually used. Keep the same resolved wallet address.
If a saved positions cursor returns 400, start again from the first page:
cursors issued before the move to Polymarket's Data API v2 can't be continued.
Crypto price cursors carry their range
For GET /v1/crypto-prices/binance, next_cursor carries the start_time of
the request that issued it, so you can follow it with only currency, limit
and cursor: the next page stays inside the range. Sending a different
start_time with a cursor is a 400, and end_time is ignored when a cursor
is sent. Pages run newest first, each the limit newest seconds at or before
the end of the last one, and walking every page returns every second of the
range exactly once.
curl -H "Authorization: Bearer $API_KEY" \
"https://api.predictorsdk.com/v1/crypto-prices/binance?currency=btcusdt&start_time=1775680500000&end_time=1775680559999&limit=30"
# next page: cursor only, from the previous pagination.next_cursor
curl -H "Authorization: Bearer $API_KEY" \
"https://api.predictorsdk.com/v1/crypto-prices/binance?currency=btcusdt&limit=30&cursor=eyJpZCI6..."Market cursors bind to an immutable snapshot
GET /v1/markets ties a traversal to the catalog as it was on its first page.
Venues refreshing in the meantime don't change what the cursor sees, so the
remaining pages come from the same catalog and nothing is skipped.
An older catalog normally stays available for up to 8 hours, though it can go sooner when storage runs short. After that, an unfinished cursor gets:
{
"code": "invalid_cursor",
"message": "pagination cursor is stale; restart from the first page",
"status_code": 400,
"param": "cursor"
}Restart from page 1 whenever a retained cursor goes stale.
snapshot.observed_at tells you how old the page is
The catalog is read from a stored copy, not from the venues, so its rows are as
old as the last crawl of each venue, not as old as your request. Every
GET /v1/markets response says how old:
{
"data": [ ],
"snapshot": { "observed_at": "2026-08-25T13:41:22.108Z" },
"pagination": { "limit": 25, "total": 1393200, "has_more": true, "next_cursor": "..." }
}Three things to know:
- It is the oldest time. Each venue is crawled on its own schedule, so the
catalog mixes crawls of different ages, and
observed_atis when the oldest of them began. Every row is at least that fresh, and most are fresher. ?provider=makes it exact. With a provider filter, it is that venue's own crawl time, the cheapest way to get a precise age for the rows you care about.- It doesn't change during a traversal. Every page of one traversal reports the same value, even while newer crawls land. Start from the first page again to see a newer catalog.
null means the bound snapshot carries no read time; treat it as unknown age
rather than as fresh.
Cursors are ephemeral
Treat cursors as short-lived: finish a traversal promptly, don't count on the full 8 hours, and don't share them between clients. Start a new first page when you want the latest data.
Default behavior
- No
limit→limit=25for matching-markets and markets; wallet positions use50on the first page and the cursor's page size on later pages; crypto prices use100. - No
cursor→ first page. limit > 100→400withcode: "invalid_parameter"andparam: "limit".- Malformed
cursor→400withcode: "invalid_cursor". - Cursor with stale scope →
400withcode: "invalid_cursor"; the message says the cursor does not match the current filters. - A
/v1/marketscursor whose catalog is gone →400withcode: "invalid_cursor"and the messagepagination cursor is stale; restart from the first page.