Key Concepts
- Cursor Pagination: Cursor pagination returns a subset of results along with a cursor that points to the next set of results. This method is more efficient than offset pagination, especially for large datasets.
- Limit: You can specify the maximum number of items to return in a single request using the
limitparameter. The default and maximum value forlimitis 100.
Request Parameters
Specifies the maximum number of items to return in the response.
Specifies the cursor that points to the next set of results.
Response Format
Each paginated response includes the following fields to help you navigate through the dataset.An array of the requested items.
A URL to the next page of results, if any.
The total number of items in the current response.
Handling Pagination
To handle pagination, follow these steps:- Initial Request: Make an initial request to the endpoint with the desired limit.
- Check for Next Page: Inspect the next field in the response. If it contains a URL, there are more results to fetch.
- Subsequent Requests: Make a subsequent request to the URL provided in the next field to retrieve the next set of results.
- Repeat: Repeat steps 2 and 3 until the next field is null, indicating there are no more results.