Pagination

The Offerte Adviseur API uses pagination to handle large result sets. By default, all list endpoints return 10 items per page. You can customize this using the per_page parameter, up to a maximum of 100 items.

When an API response returns a list of objects, they are nested in a data attribute and include pagination metadata in the links and meta attributes. The links object provides URLs for navigating between pages, while the meta object contains information about the current page and total results.

Pagination parameters

You can control pagination using these query parameters:

  • Name
    page
    Type
    integer
    Description

    The page number to retrieve. Default is 1.

  • Name
    per_page
    Type
    integer
    Description

    Number of items per page. Default is 10, maximum is 100.

curl https://app.offerteadviseur.nl/api/categories \
  -H "Authorization: Bearer eyJ..." \
  -H "Accept: application/json" \
  -G \
  -d page=2 \
  -d per_page=20

Understanding the response

The paginated response includes:

Links object

  • first: URL for the first page
  • last: URL for the last page
  • prev: URL for the previous page (null if on first page)
  • next: URL for the next page (null if on last page)

Meta object

  • current_page: The current page number
  • from: The starting result number
  • last_page: The last page number
  • path: The base URL path
  • per_page: Number of items per page
  • to: The ending result number
  • total: Total number of items across all pages

Endpoints supporting pagination

The following endpoints support pagination:

Each endpoint's documentation includes specific examples of how pagination works for that resource.

Was this page helpful?