Pagination
The Collate API uses cursor-based pagination for list endpoints. This ensures consistent results even when data changes between requests.Pagination Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 10 | Number of results per page. Main list endpoints commonly allow up to 1,000,000; individual endpoints can define lower caps. |
before | string | - | Cursor for previous page |
after | string | - | Cursor for next page |
offset | integer | 0 | Number of results to skip. Available on specific sub-resource endpoints, for example /v1/tables/{id}/columns. Not supported on main list endpoints; use before/after cursors instead. |
Response Fields
The exactpaging fields vary by endpoint and pagination mode:
| Field | Type | Description |
|---|---|---|
total | integer | Total count of matching resources |
before | string | Cursor for the previous page when available |
after | string | Cursor for the next page when available |
offset | integer | Current offset position when the endpoint returns offset-based paging |
limit | integer | Page size when the endpoint returns offset-based paging |
Examples
Basic Pagination
Basic Pagination
Offset-Based Pagination
Useoffset on sub-resource endpoints such as /v1/tables/{id}/columns. Endpoint-specific defaults and caps apply; table columns are limited to 1,000 columns per request and default to 50.
offset still return paging.before and paging.after as previous and next page markers. Follow the response fields returned by the endpoint you are calling.
Iterating Through All Results
Iterating Results
Filtering with Pagination
Combine pagination with filters for efficient data retrieval:Filtering
Include Fields
Control which fields are returned in the response using thefields parameter:
owner- Include owner informationtags- Include tags and classificationscolumns- Include column definitionsfollowers- Include followerstableConstraints- Include constraintsusageSummary- Include usage statistics
Best Practices
Use reasonable page sizes
Start with
limit=50-100. Larger pages reduce API calls but increase memory usage. Check the endpoint’s maximum limit before increasing page size.Use the pagination mode from the response
For cursor-based list endpoints, use
before and after sequentially. For endpoints that expose offset, advance by the page size or follow the next marker returned in paging.Handle empty results
Check if the
data array is empty. For cursor-based pagination, stop when after is null. For offset-based requests, stop when the response returns fewer records than requested or no next marker is present.Request only needed fields
Use the
fields parameter to reduce response size and improve performance.Pagination vs Search
For finding specific resources, consider using the Search API instead of paginating through all results:Search API
Learn about searching and filtering metadata