Skip to main content

Pagination

The Collate API uses cursor-based pagination for list endpoints. This ensures consistent results even when data changes between requests.

Pagination Parameters

Response Fields

The exact paging fields vary by endpoint and pagination mode:

Examples

Basic Pagination

Basic Pagination

Offset-Based Pagination

Use offset 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.
Some endpoints that accept 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 the fields parameter:
Common field options for tables:
  • owner - Include owner information
  • tags - Include tags and classifications
  • columns - Include column definitions
  • followers - Include followers
  • tableConstraints - Include constraints
  • usageSummary - Include usage statistics

Best Practices

1

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.
2

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.
3

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.
4

Request only needed fields

Use the fields parameter to reduce response size and improve performance.
5

Implement retry logic

Handle transient errors gracefully when paginating through large datasets.
For finding specific resources, consider using the Search API instead of paginating through all results:

Search API

Learn about searching and filtering metadata