> For the complete documentation index, see [llms.txt](https://docs.hostinger.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hostinger.com/api-reference/pagination.md).

# Pagination

How list endpoints in the Hostinger API paginate — the page and per\_page query parameters, the meta object in the response, and how to walk every page from a script.

List endpoints that can return large collections are paginated. Instead of one enormous response, you request a page at a time and the response tells you how many items exist in total.

Paginated endpoints are the ones that accept a `page` query parameter — 43 of them across hosting, agency hosting, mail, Reach, VPS and ecommerce. Every [endpoint page](/api-reference/endpoints.md) lists its own parameters, so check there when you're unsure.

Endpoints that return a small, bounded collection — data centers, OS templates, a website's cron jobs — aren't paginated and return everything at once.

## Requesting a page

| Parameter  | Type    | Default | Notes                                   |
| ---------- | ------- | ------- | --------------------------------------- |
| `page`     | integer | `1`     | Which page to return.                   |
| `per_page` | integer | `25`    | How many items per page. Maximum `100`. |

```bash
curl "https://developers.hostinger.com/api/hosting/v1/websites?page=2&per_page=50" \
  -H "Authorization: Bearer $HOSTINGER_API_TOKEN"
```

> **Note:** Not every paginated endpoint accepts `per_page`. The VPS and ecommerce list endpoints, along with `GET /api/reach/v1/contacts`, take `page` only and use a fixed page size.

## Reading the response

A paginated response wraps the collection in `data` and adds a `meta` object:

```json
{
  "data": [
    { "id": 1, "domain": "example.com" },
    { "id": 2, "domain": "example.net" }
  ],
  "meta": {
    "current_page": 2,
    "per_page": 50,
    "total": 137
  }
}
```

| Field          | Meaning                                                         |
| -------------- | --------------------------------------------------------------- |
| `current_page` | The page you just received.                                     |
| `per_page`     | Items per page actually applied.                                |
| `total`        | Total items across all pages — not the number in this response. |

There is no `last_page` field and no `next` link. Calculate the page count yourself: `ceil(total / per_page)`, or keep requesting until a page comes back with an empty `data` array.

## Walking every page

Keep requesting until you've collected `total` items, or until a page comes back empty.

```bash
page=1
while :; do
  body=$(curl -s "https://developers.hostinger.com/api/hosting/v1/websites?page=$page&per_page=100" \
    -H "Authorization: Bearer $HOSTINGER_API_TOKEN")

  count=$(echo "$body" | jq '.data | length')
  [ "$count" -eq 0 ] && break

  echo "$body" | jq -r '.data[].domain'
  page=$((page + 1))
done
```

In Python, the same loop against the [SDK](/api-reference/sdks.md):

```python
page = 1
while True:
    response = websites.list_websites_v1(page=page)
    if not response.data:
        break
    for website in response.data:
        print(website.domain)
    page += 1
```

> Each page is a separate request and counts against your [rate limit](/api-reference/overview.md#rate-limits). Use `per_page=100` when you're paging through a large collection — it's the difference between 2 requests and 8 for the same 200 items.

## Pagination and the other tools

The [CLI](/api-reference/cli.md) and the [SDKs](/api-reference/sdks.md) expose `page` and `per_page` as ordinary arguments and don't paginate for you — the loop above is yours to write. See [Scripting with the CLI](/api-reference/cli-scripting.md) for piping paged output into a script.

***

*Last updated: September 10, 2026*
