Skip to main content

Pagination

When you make GET requests to API People APIs, you might encounter very large datasets. Pagination is a technique used to manage these large datasets by breaking them into smaller, more efficient subsets. Instead of returning thousands of results in a single response, the API sends a manageable subset, making processing more efficient.

How it Works

You typically use two query-params in your GET requests to control pagination:

  • offset: Specifies how many records to skip from the beginning of the dataset.
  • limit: Determines how many records to return in the current response.

See the following examples:

  • This call retrieves the first 15 transactions:
    GET /transactions?offset=0&limit=15
  • This call provides the next 15 transactions, specifically records 15 to 30:
    GET /transactions?offset=15&limit=15

Response

API People APIs include a pagination object within API responses to help you navigate through results.

    {
"events": [
{}
],
"pagination": {
"offset": "20",
"moreResults": true
}
}

This object contains two key fields:

  • offset: Indicates the starting point for your next API call.
  • moreRecords: A boolean value that is true if there are more records to retrieve, and false if all records have been returned.
info

Always check the moreRecords field in the pagination object of the API response. This tells you if there are more records to fetch. Doing this helps you get all the data you need and manage your calls effectively within API People's system.