Pagination
Our API employs pagination to manage the retrieval of large datasets efficiently. Pagination is implemented through the use of limit
and offset
parameters in the GET request. This approach allows clients to control the number of records retrieved in a single response and to navigate through large sets of data incrementally.
Parameters
- limit: Specifies the maximum number of records to return in a single response. The maximum allowable value for this parameter is
100
. - offset: Indicates the starting position from which to return records. This parameter is used to skip a specified number of records from the beginning of the dataset.
Usage
To apply pagination, include the limit
and offset
parameters in your GET request query string.
Example Request
GET https://api.example.com/items?limit=20&offset=40
This request would retrieve 20 records, starting from the 41st record (since the offset is 0-based).
Limits
The maximum limit for any endpoint is 100
records per request. Requests attempting to set a limit
value greater than 100
will be automatically capped at 100
.
Navigating Data Pages
To navigate through datasets, adjust the offset
parameter based on the limit
value. For example, to retrieve the next set of records, increase the offset
by the limit
value used in the previous request.
Best Practices
- Use consistent
limit
values for sequential requests to ensure predictable pagination behavior. - Keep track of the
offset
andlimit
values to efficiently navigate back and forth within the dataset.
Incorporating these pagination parameters in your API requests ensures efficient data retrieval and management, particularly when dealing with large volumes of data.