Pagination
All collection endpoints in Ptolemy use cursor-based pagination. Cursors are stable, efficient, and safe to use across concurrent writes — unlike offset pagination, they won't skip or duplicate rows.
How cursor pagination works
Each list response includes a meta object with a next_cursor and has_more flag. When has_more is true, pass the next_cursor value as the after parameter in your next request to fetch the following page.
When has_more is false, you’ve reached the last page. next_cursor will be null.
Pagination parameters
Cursors are opaque base64-encoded strings. Do not attempt to decode, construct, or modify them — their internal structure may change. Always use the cursor exactly as returned.
Pagination with the filter API
The POST filter endpoint supports the same pagination model, but parameters are passed in the request body rather than as query parameters:
Iterating all records
To fetch all records, loop until has_more is false:
Best practices
Use large page sizes
Set
limit: 200 (the maximum) when fetching all records to minimise the number of requests and API calls consumed.Process sequentially
Fetch pages one at a time. Making concurrent requests for multiple pages is wasteful and risks triggering burst throttling.
Don't cache cursors
Cursors can expire if not used within a reasonable time. Always fetch fresh from the previous response.
Use count for planning
Call
POST /instruments/count first to estimate total record count before starting a full iteration.