Pagination

1min

All top-level API resources have support for bulk fetches through “list” API methods. For example, you can list breeds, list pets, and list invoices. These list API methods share a common structure and accept, at a minimum, the following two parameters: page, per_page.

The per_page parameters refers to the maximum number of resources to be returned in one bulk fetch. The parameter is limited at 1000 for performance purposes. If ommited, the parameter defaults to the value 15.

The page parameter refers to the current page of the pagination and will only return the entities from (page-1) * per_page to page * per_page. If ommitted, the paramter defaults to the value of 1.

All paginated responsed will have the entities wrapped in a data attribute and will contain two additional metadata attributes: links and meta. Links offer useful shorcuts to retrieving the first, last, previous or next page while metadata contains information such as the total number of resources available, the number of resources on the current page, etc.



Example payload:

JSON