---
title: Pagination
slug: pagination
docTags: 
createdAt: 2024-04-12T13:36:59.455Z
---

All top-level API resources have support for bulk fetches through “list” API methods. For example, you can [list breeds](https://documentation.digitail.io/get-a-list-of-breeds), [list pets](https://documentation.digitail.io/get-a-list-of-pets), and [list invoices](https://documentation.digitail.io/get-a-list-of-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:**

:::CodeblockTabs
JSON

```json
{
  "data": [{}, ...entities here..., {}],
  "links": {
     "first": "https://vet.digitail.io/api/v1/entities?page=1",
     "last": "https://vet.digitail.io/api/v1/entities?page=10",
     "prev": null,
     "next": "https://vet.digitail.io/api/v1/entities?page=2"
  },
  "meta": {
    "current_page": 1,
    "last_page": 10,
    "from": 1,
    "to": 15,
    "per_page": 15,
    "total": "98",
    "path": "/api/v1/entities"
  }
}
```
:::

