Pagination

Pagination

Pagination allows you to efficiently retrieve large datasets in manageable chunks, reducing load and improving performance.

Rows Get and Query DATA API

When using the Rows Get, or Query API, pagination is controlled by three parameters: totalRecords, skip, and limit.

To paginate results:

  1. Start with an initial query, setting limit = 1000 and skip = 0.
  2. Check the value of totalRecords in the response. If it is greater than your limit, you need to make additional requests to retrieve all data.
  3. For each subsequent request, increment the skip value by page number * limit (e.g., skip=1000, skip=2000, etc.), keeping the same limit value.
  4. Continue until all records are retrieved. If you request beyond the available pages, the API will return a 200 OK response with an empty rows array.

You may choose any value for limit up to a maximum of 10,000.

Best Practices

  • Use the largest limit value that is practical for your application to minimize the number of requests.
  • Always check totalRecords to determine how many requests are needed.
  • Handle empty rows arrays gracefully, as they indicate there are no more records to retrieve.
  • When skip and limit are not included as parameters, default values of 0 and 1000 are applied respectively.

Examples

In this example, we set limit=4. With 14 records, 4 requests are needed to retrieve all data. The first 3 requests return 4 rows each, and the final request returns the remaining 2 rows.

GET {baseUrl}/api/rest/v4/data/entrydata/rows/Address?limit=4&skip=0
Content-Type: application/json