Source: https://atomic-works-test.docs-staging.pageloop.ai/api-reference/getting-started/pagination

# Pagination

---
description: >-
  Learn how to use cursor-based pagination in the Sprinto Developer API to
  efficiently fetch and navigate large datasets.
---

# Pagination

The Sprinto Developer API uses **cursor-based pagination** to help you efficiently work with large datasets. Pagination allows you to fetch smaller, manageable subsets of data, improving response time and overall API performance.

Sprinto’s pagination model aligns with the **Relay Cursor Pagination specification**, making it predictable and easy to work with in GraphQL-based integrations.

For a hands-on experience, Sprinto recommends using the API Playground to explore paginated queries interactively.

***

### Important notes

* The Sprinto Developer API is currently in beta, and pagination behaviour may evolve as new features are introduced.
* API requests are rate-limited to **10 requests per minute**. Exceeding this limit results in an error response.
* Pagination parameters and response structures are enforced at the schema level.

***

### Pagination model

Sprinto uses **cursor-based pagination**, where each record is associated with a unique cursor. Instead of relying on page numbers, cursors allow you to reliably navigate forward and backward through a dataset.

This approach ensures consistency even when underlying data changes.

***

### Supported pagination arguments

The following pagination arguments are supported across paginated queries.

<table><thead><tr><th width="111.86328125">Argument</th><th>Description</th></tr></thead><tbody><tr><td><code>first</code></td><td>Specifies the number of records to fetch in a single request.</td></tr><tr><td><code>after</code></td><td>Fetches records that appear after the specified cursor. Used for forward navigation.</td></tr><tr><td><code>before</code></td><td>Fetches records that appear before the specified cursor. Used for backward navigation.</td></tr></tbody></table>

***

### Pagination response structure

Paginated responses follow a consistent structure based on connections and edges.

<table><thead><tr><th width="132.2734375">Field</th><th width="520.70703125">Description</th></tr></thead><tbody><tr><td><code>edges</code></td><td>A list representing individual records in the result set.</td></tr><tr><td><code>cursor</code></td><td>A unique identifier for each edge, used for pagination navigation.</td></tr><tr><td><code>node</code></td><td>The actual data object returned by the API.</td></tr><tr><td><code>totalCount</code></td><td>The total number of records available for the query.</td></tr></tbody></table>

***

### Example: Paginated query

The following example retrieves the first five workflow checks that appear after a specific cursor.

{% tabs %}
{% tab title="Query" %}
```javascript
query WorkflowChecksPaginated($first: Int, $after: String) {
  workflowChecksPaginated(first: 5, after: "dfsdfdscdsfsadcdsafasdcdsfcddsfc--00fdc") {
    edges {
      cursor
      node {
        title
      }
    }
    totalCount
  }
}
```
{% endtab %}

{% tab title="Response" %}
```python
{
  "data": {
    "workflowChecksPaginated": {
      "edges": [
        {
          "cursor": "dsfasfsdfewrfdcdGRFGVSAVS=CV==",
          "node": {
            "title": "Periodic review of the users having access to Lokmat"
          }
        }
        // ... additional workflow checks
      ],
      "totalCount": 110
    }
  }
}
```
{% endtab %}
{% endtabs %}

***

### How pagination works in practice

1. Use the `first` argument to define how many records you want to retrieve.
2. Extract the `cursor` value from the last edge in the response.
3. Pass that cursor value as the `after` argument in the next request to fetch the next set of records.
4. Repeat the process until all required records are retrieved.

For backward navigation, use the `before` argument with the cursor from the first edge in the current response.

***

### Next steps

After understanding pagination, you can:

* Combine pagination with filters and arguments for more precise queries
* Use pagination consistently when building reports or dashboards
* Explore paginated queries directly in the API Playground
