Pagination

Pagination

This section explains the pagination mechanism for all list endpoints in our API. Pagination allows clients to retrieve a subset of data from a larger dataset by specifying the limit and offset request parameters. The API responds with the requested data and provides the total count of items available.

Request Parameters

  • limit

    • Description: The limit parameter determines the maximum number of items to include in each page of results.
    • Default: If not provided, it defaults to a predetermined value described in the API Reference.
    • Example: ?limit=25
  • offset

    • Description: The offset parameter specifies the starting point within the dataset. It indicates how many items to skip before returning data.
    • Default: If not provided, it defaults to 0.
    • Example: ?offset=50

Response Format

The API responds with a JSON object containing the requested data and the total count of items available:

{
  "data": [/* Array of paginated data */],
  "total": /* Total number of items in the dataset */
}

If the provided offset value exceeds the total number of items available, the API will respond with an empty data array.

Example

The following example illustrates the process of navigating through the dataset using pagination.

  • GET /items?limit=100
    • Returns data with first 100 items and total: 220
  • GET /items?limit=100&offset=100
    • Returns data with next 100 items and total: 220
  • GET /items?limit=100&offset=200
    • Returns data with last 20 items and total: 220