/results endpoints to facilitate efficient data retrieval by dividing large datasets into smaller, manageable chunks. This feature helps prevent overload, ensures smoother performance, and enhances the user experience by making it easier to navigate through data, thus avoiding limit errors. Pagination is available for the following endpoints:
Pagination can be effectively combined with filtering and sorting to optimize data fetching.
Example Paginating Request
- Python SDK
- cURL
- Python
- Javascript
- Go
- PHP
- Java
- Use the
limitparameter to set the maximum number of results per request. - The
offsetparameter defines the starting point for the data retrieval, with a default value of 0 (the first row). - For JSON responses, the
next_offsetandnext_urifields in the response body indicate how to fetch the next page. For CSV responses, look for theX-Dune-Next-OffsetandX-Dune-Next-Uriheaders. The server may adjust the provided limit if deemed too large, ensuring efficient data handling. Follow these indicators to navigate through the dataset seamlessly.
Pagination Parameters
limit (required)
- Type:
integer - Description: Specifies the maximum number of rows to return in a single request, controlling the page size for pagination.
offset
- Type:
integer - Description: Determines the starting point for data retrieval, allowing for sequential access through the dataset.
- Default: 0 (the first row)
- Usage: Use in conjunction with
limitto navigate through results in an efficient, incremental manner.
Pagination in Response
The following fields in the response body are related to pagination and can be utilized when doing paginated get results request. If they are available, you can use them to paginate the next page. If they are not available, that means there are no more results to be fetched.- JSON response endpoints
- CSV response endpoints
next_offset- Type: Integer
- Description: Provides the offset to use for retrieving the next page of results, if available.
next_uri- Type: String (URL)
- Description: Specifies the complete URI to retrieve the next page of results, if available.
If you pass in an invalid
offset parameter value, you will get an empty result set. For example, if there are only 25 rows of result data, and you pass in offset=30, you will not receive an error, but rather an empty result with metadata like this. Note the response field result.total_row_count, indicating this result has only 25 rows.Example empty response
Example empty response
Example paginated response
Example paginated response