Skip to main content

Pagination

Endpoints that return lists of resources are paginated. You control pagination with two parameters:

  • page: which page to retrieve (starts at 1)
  • offset: how many items per page (minimum 1, maximum varies per endpoint)

The default offset on most endpoints is 12.

GET endpoints

For GET requests, pass pagination as query parameters:

GET /v2/products?page=1&offset=10

GET /v2/products?page=2&offset=20

GET /v2/products?page=3

POST search endpoints

For POST search endpoints, include pagination in the request body:

{
"filters": {
"categories": ["electronics", "computers"]
},
"page": 1,
"offset": 15
}

Response metadata

Every paginated response includes metadata alongside the data array:

{
"data": [
{ "id": 56897, "name": "Product 1" },
{ "id": 36975, "name": "Product 2" }
],
"messages": ["Completed"],
"start": 1,
"end": 2,
"page": 1,
"pages": 20,
"total": 2,
"offset": 2,
"itemsFound": 35
}
FieldTypeDescription
dataarrayArray of resources for the current page
startintegerFirst item number on the current page
endintegerLast item number on the current page
pageintegerCurrent page number
pagesintegerTotal number of pages
totalintegerNumber of items on the current page
offsetintegerNumber of items per page
itemsFoundintegerTotal number of items across all pages

To iterate through all results, loop from page 1 to pages, incrementing by 1.

See also