The one rule
Ask for up tolimit items. If the response’s data.nextCursor is not null, there
is more, so call again with it as cursor. When nextCursor is null, you have reached
the end.
That single loop works for every paginated API and never changes:
What the fields mean
limitis the most items you want in this response: a page cap, not a grand total. You always get up to one page; follownextCursorfor more.cursoris an opaque token from a previous response’snextCursor. Pass it to continue, or omit it to start from the first page. Do not parse or build it yourself: it is sealed and tied to one walk.nextCursoris in the response atoutput.data.nextCursor. A non-null value means there is more;nullmeans you have reached the end of this walk.
Each paginated API returns a fixed page size (often around 50). A walk is one consistent
enumeration: keep following the cursor and you will see every result, in order, without
duplicates. If a cursor ever comes back rejected, it has expired, just start the walk
again from the first page.
Get everything in one call
If you cannot loop, for a spreadsheet import, a no-code tool, or a one-shot job, setrequireSinglePage: true to receive up to limit items in a single response instead
of cheap pages. A bulk provider serves it, so it costs more, and a very large limit may
be rejected with a clear message asking you to lower it or paginate.
curl
Cost
Paging is the cheap path: each page is a flat, low per-request price, so walking a few pages costs far less than one big bulk call.requireSinglePage trades that for
convenience at a higher price. Either way you pay only for what you receive, in real USD:
your exact costUsd is on every response.