Large lists of resources can be read iteratively through pagination. This allows the systematic consumption of many resources in manageable pages of 30 items each. If a request returns more than 30 items, the response contains a Link header pointing to the next page of results.



When paginating actions, property histories, Thngs, or products, the parameters shown below can be used to request successive pages of a resource type.

Other resource types (such as collections, accounts, applications, batches, files, jobs, places, users, projects, and so on) paginate slightly differently: a page parameter in the Link header, and an extra x-result-count header.

This is subject to change in the future to align all resource types to paginate in the same manner. Don't rely on these extra pieces of information. Consider them deprecated.

Query Parameters

The following query parameters are available for pagination requests for most resource types.

  • sortOrder - Enum
    Choose the sort order. Resources are returned in descending order by default. To specify a preference, include a value of DESCENDING or ASCENDING.

  • perPage - Integer
    Choose the page size from a minimum of 1 item to a maximum of 100 items. The default page size is 30 items.

Getting the Next Page

The response from a paginated request includes a Link header. This header includes the URL-encoded address indicating where the next page of items can be found, if available.

Your application uses this URL to request the next page. This URL must not be modified (except to be decoded as needed).

An example is shown below:

HTTP/1.1 200 OK
Content-Type: application/json
link: <>; rel="next"



The Link header only contains the URL of the next page.

Example Request

To retrieve two items per page:

GET /thngs?perPage=2&sortOrder=ASCENDING
Content-Type: application/json
Authorization: $OPERATOR_API_KEY
curl -i -H "Content-Type: application/json" \
  -H "Authorization: $OPERATOR_API_KEY" \
  -X GET ''
const params = { perPage: 2 };
operator.thng().read({ params })

// Or with param setters
Iterator<PVector<Thng>> thngs = apiManager.thngService().iterator()
while (thngs.hasNext()) {
    PVector<Thng> page =;
    for (Thng thng : page) {
        System.out.println("Thng: " + thng);
HTTP/1.1 200 OK
Content-Type: application/json
link: <>; rel="next"

    "id": "UE5N4YhHmDxcK4xAdrqpQrbr",
    "createdAt": 1472046970112,
    "updatedAt": 1472046970112,
    "name": "Plug #43789",
    "description": "A smart plug connected to the web",
    "id": "Uh6RAddC4DT3bNRKRaARMCfc",
    "createdAt": 1472213813953,
    "updatedAt": 1472213813953,
    "name": "Plug #43790",
    "description": "A smart plug connected to the web",

Using JavaScript Iterators

The evrythng.js SDK enables you to iterate through all items in a collection without manually paginating. An example is shown below:

const readAllProducts = async () => {
  const products = [];
  const iterator = app.product().setPerPage(100).pages();

  // Iterate through all pages
  let page;
  while (!(page = await {
  return products;

To iterate and perform operations on a list of resources, use the stream() or streamPages() methods instead:

const deleteProduct = async (product, totalSoFar) => {
  await operator.product(;
  console.log(`Deleted product ${totalSoFar}`);

// One resource at a time
  .then(() => console.log('Complete!'));

// Or, one page of items at a time
  .streamPages((page) => Promise.all(
  .then(() => console.log('Complete!'));