How a page is bounded
Two things cap a single response:limitsets the maximum rows returned. The default and ceiling vary by route (for example, trades default 100 / max 1000; order routes default 1000 / max 10000). Check the data-type page or OpenAPI for the exact numbers.- The time window (
start/end) bounds the range. A narrow window plus a sensiblelimitkeeps each page fast.
Follow the cursor
Every paginated response carriesmeta.next_cursor. To get the next page, send it back as the cursor query parameter:
meta.next_cursor is absent or null, you have reached the end of the window.
Treat the cursor as opaque
Cursor encodings differ by route: some are composite strings such astimestamp_tradeId, others are integers. Do not parse, construct, or compare cursors. Store the exact value you received and pass it back unchanged. That keeps your iteration correct even if the encoding changes.
Resumable backfills
For a long backfill, persist the lastnext_cursor (and the window you are walking) with your job state. A run that stores its cursor can pause and resume without duplicating rows or re-pulling the whole range. Keep meta.request_id per page in your logs so a failed page is traceable.