Pagination

How to paginate list responses from the Servers.com Public API.

We use GitHub style pagination with WebLinking. Each request contains query parameters to adjust pagination:

  • page defines the ordinal number of a page to be displayed in the output. A request sample showing the second page of a hosts list:
curl -i -H "Authorization: Bearer API-TOKEN" -g "https://api.servers.com/v1/hosts?page=2" -X GET
  • per_page sets up the quantity of items to be displayed on one page. Maximum 100 results per page. A request sample to show 100 host items on each page:
curl -i -H "Authorization: Bearer API-TOKEN" -g "https://api.servers.com/v1/hosts?per_page=100" -X GET