Overview
To maintain consistency, offset pagination is recommended as the default approach. However, datasets won’t always be small, so APIs can also support cursor-based pagination as an optional alternative for handling large datasets efficiently.- Offset pagination: Default method (recommended)
- Cursor-based pagination: Optional advanced method for large datasets
Offset Pagination
Offset pagination is the standard pagination method using page numbers.Response Structure
Query Parameters
Control the number of results per pageMaximum recommended: 100
Current page (zero-indexed)Note: Page numbering starts at 0
Example Request
Example Response
Offset Pagination Fields
Number of items returned in the current page
Current page number (zero-indexed)
Total number of pages available
Total number of results matching the current query filters
Total number of items in the database without any filters appliedOptional field
Cursor-Based Pagination
Cursor-based pagination is more efficient for large datasets and provides better performance when data is frequently updated.Response Structure
Query Parameters
Control the number of results per page
Cursor position for the current pageUse the
nextCursor or prevCursor values from the previous responseExample Request
Example Response
Cursor Pagination Fields
Number of items returned in the current response
Cursor for the next page of resultsWill be
null if on the last pageCursor for the previous page of resultsWill be
null if on the first pageTotal number of results matching the current query filters
Total number of items in the database without any filters appliedOptional field
Choosing a Pagination Method
Use Offset Pagination When:
- Dataset is small to medium-sized (< 10,000 records)
- Users need to jump to specific page numbers
- Total page count is important for UI
- Data doesn’t change frequently
Use Cursor-Based Pagination When:
- Dataset is very large (> 10,000 records)
- Performance is critical
- Data is frequently updated
- Sequential access is sufficient
- Real-time feeds or infinite scroll UI
Implementation Notes
Page Indexing: Offset pagination uses zero-based indexing. The first page is
page=0.Cursor Format: Cursor values are opaque strings (typically base64 encoded). Clients should not attempt to parse or construct cursor values manually.
Next Steps
Filtering
Learn about filtering and search parameters
Endpoints
See pagination in action on specific endpoints