---
updatedAt: 2025-09-10T21:00:58.000Z
agentTools:
  projectIndex: https://developer.zylo.com/llms.txt
---

# Skip Pagination

```node Node
// Limit constant
const baseLimit = 100;

// Base API URL
const url = new URL('https://api.zylo.com/v2/applicationUsers');
url.searchParams.set('limit', baseLimit);

// API headers and options
const options = {
  method: 'GET',
  headers: {
    accept: 'application/json',
    authorization: 'Bearer <<user>>'
  }
};

// Function to page through results
async function fetchAllApplicationUsers() {
  let skip = 0;
  let keepGoing = true;

  while (keepGoing) {
    url.searchParams.set('skip', skip);

    const res = await fetch(url, options);
    const data = await res.json();

    // Handle the results (e.g., log them or store them)
    console.log(data);

    // If fewer rows are returned than the limit, we've reached the end
    if (data.length < baseLimit) {
      keepGoing = false;
    } else {
      skip += baseLimit;
    }
  }
}

// Run it
fetchAllApplicationUsers().catch(err => console.error(err));

```

```json Response Example
{"success":true}
```

# Set Up API Endpoint

<!-- node@1-15 -->

Sets up the base parameters for the API endpoint, including the headers and limit query parameter.

# Create Function for Loop

<!-- node@17-18 -->

This function will be used to loop through the Application Users results with the skip parameter.

# Loop Variables

<!-- node@19-20 -->

The `skip` parameter is used to paginate through the results. If the parameter is set to 100, it will skip the first 100 results before fetching data. The `keepGoing` variable is used to tell us when to close the loop.

# Fetch the Results

<!-- node@22-37 -->

This step involves creating the logic to fetch the results. While the `keepGoing` variable is `true`, the logic will continue. Each iteration will add 100 to the `skip` value. The loop will finish once the rows fetched from the API call are less than the `limit`.

# Execute the Function

<!-- node@40-41 -->

This line executes the function that was made above.