Skip to main content

Pagination

List endpoints return large result sets in pages. Use the limit and offset query parameters to control how many records you pull in each request and to page through the results.

To speed up large data pulls by sending requests in parallel, see Concurrency.

Query parameters​

ParameterDescriptionDefault
limitNumber of records to return in one request.10
offsetNumber of records to skip before the first returned record.0

The maximum limit is usually 100, but it varies by endpoint (for example, some endpoints allow up to 50 or 200). Check the limit parameter on the endpoint page in the API reference.

Paging through results​

When requesting a large number of records, a single large request may be interrupted or truncated. Break it up into multiple smaller requests instead.

Example: You want to retrieve 1,000 purchase orders (POs). Instead of making one large request, make ten requests of 100 POs each:

RequestParametersReturns
1offset=0&limit=100POs 1–100
2offset=100&limit=100POs 101–200
………
10offset=900&limit=100POs 901–1,000
curl --url "https://sight.inspectorio.com/api/v1/purchase-orders?offset=100&limit=100" \
--header "apiKey: <YOUR_API_KEY>"

Most list endpoints return the pagination values and the total number of matching records along with the data:

{
"data": [ ... ],
"limit": 100,
"offset": 100,
"total": 1000
}

Keep requesting the next page (offset + limit) until offset reaches total.

note

A few endpoints use a different response format. For example, some return count with next and previous links, and the V3 List Purchase Orders endpoint returns a plain array. Check the response schema on the endpoint page.

Syncing only what changed​

Instead of pulling all records every time, use the date-range filters available on many list endpoints to pull only records created or updated since your last sync. For example:

Parameter names and date formats vary by endpoint. Check the endpoint page for the exact filters it supports.