Skip to main content

Pagination

Pagination on GET /v1/offers is optional. By default the endpoint returns all available offers in a single response. To page through results, add the per_page query parameter.

Parameters

ParameterTypeNotes
per_pageintegerNumber of offers per page, 1–100. Providing it enables a paginated response.
pageintegerPage number to retrieve, 1-indexed. Defaults to 1 when per_page is set. Cannot be used without per_page.
caution

Passing page without per_page returns 422 (validation error). Always send per_page to paginate. See Errors.

Paginated response

When per_page is provided, the response data includes a pagination object:

{
"status": "success",
"data": {
"offers": [ /* ... */ ],
"pagination": {
"current_page": 1,
"per_page": 25,
"has_more_pages": true,
"next_page": 2
}
}
}
FieldTypeDescription
current_pageintegerThe current page number.
per_pageintegerOffers per page.
has_more_pagesbooleanWhether more pages are available.
next_pageinteger | nullThe next page number, or null on the last page.

Iterating

Start at page=1 and increment while has_more_pages is true (equivalently, until next_page is null). When per_page is omitted, all offers are returned at once and no pagination object is present.