close
For the complete documentation index, see llms.txt. This page is also available as Markdown.

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 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.

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:

{
  "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.

In Python, the same loop against the SDK:

Each page is a separate request and counts against your rate limit. 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 and the SDKs 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 for piping paged output into a script.


Last updated: September 10, 2026

Last updated

Was this helpful?