Skip to main content
Follow next_cursor. Send it back as cursor on the next call, and stop when the response omits it.
cURL
next_page and previous_page are always null. They are deprecated and no endpoint populates them.A loop that treats next_page: null as “last page” stops after the first page and reads as a completed walk. That is the failure this page exists to prevent: a namespace with 130 collections returning its first 100 and nothing signalling that 30 were missed.

The response object

Request parameters

Every list endpoint accepts all of these as query parameters. Pick one style and keep to it.
next_cursor and after are accepted as aliases specifically because the response calls the field next_cursor, so sending it straight back is the natural thing to do. An undeclared query parameter is dropped silently before any handler sees it, which is what made an earlier version of this loop run forever.

Walking a list to the end

Python
The termination condition is the absence of next_cursor, not next_page, and not an empty result set. A page can be short without being last.

Filters

Narrowing a list before you page through it.

Rate limits

What a tight pagination loop counts against.