Paging
Every list takes limit and cursor.
json
"meta": {
"page": {
"limit": 100,
"hasMore": true,
"nextCursor": "eyJvIjoxMDAs…",
"total": null,
"retryAfter": null
},
"next": "/v1/gpu/prices?limit=100&cursor=eyJvIjoxMDAs…"
}python
url = "/v1/gpu/prices?limit=100"
while url:
page = get(url)
wait = page["meta"]["page"]["retryAfter"]
if wait:
sleep(wait)
continue
rows += page["data"]
url = page["meta"]["next"]- Request
meta.nextuntil it is null. Where a route counts its rows,meta.page.totalis how many match on every page. A change feed counts none: itstotalis null. - A page whose rows were still being read when it answered has
meta.page.retryAfter, in seconds, and the sameRetry-Afterheader: it may hold fewer rows than the query matches, and itshasMore: falseis not the end. Send the same request again after that wait. That page is free; the repeat is charged as usual. On every other pageretryAfteris null. - In a batch,
limitcounts per listing and one cursor pages them all;meta.page.totalcounts every listing's rows, on every page. - Without
limit, a route reads its default page size, listed in the reference. - A cursor belongs to its query. Change a filter and start again;
limitmay change between pages. - A cursor from another query is a free
400 cursor_invalid. - Search and SEC lists page 5,000 rows deep: 100 pages of 50. The last page stops at row 5,000 with
hasMorefalse and, with rows left, adepth_limitnotice that names the route's window,fromandtoon/filings. Split the window to reach older rows.POST /v1/datasets/costsays how many rows a listing holds. - A change feed ends
meta.nextonce caught up, but itsmeta.cursorstays where your next poll resumes: send it ascursor./v1/insider-trades/changesand/v1/catalysts/changesgive one for all theirsymbols;/v1/catalysts/changesalso gives each listing's inmeta.symbols. - Routes that do not page answer
"page": null.
Only what changed
updatedSince keeps the rows updated at or after a moment, on /v1/perps/markets, /v1/hiring/momentum and /v1/gpu/prices. It pages like any other filter, and meta.page.total and meta.coverage count only the rows it keeps.
python
from urllib.parse import quote
url = f"/v1/hiring/momentum?updatedSince={quote(last_sync)}"- It is inclusive: a row updated at exactly
last_synccomes back again. Start from the last sync's time and drop rows you already hold. - URL-encode the time. A
+in an offset such as+02:00reads as a space and is a400that says to send%2B02:00. - Perpetual markets are read from their venue every few minutes, so most active markets match each poll.
- Each page is charged like any other, even when it holds no rows. A listing read with
symbols=that finds nothing stays free, as in any batch.