> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tight.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pagination

> Page efficiently through Tight API resources

## Get Started

All top-level Tight API resources support pulling data in bulk by utilizing cursor-based pagination.

To get started, simply specify the `limit`, which is the number of items to return on that page:

```bash theme={null}
curl -X POST https://sandbox.tight.com/v6/banks/transactions/query \
-H 'Authorization: Bearer <access_token>' \
-D '{
        "limit": 100
    }'
```

The response will contain an array of items up to your specified `limit` in `data` and a `cursor` object:

```json theme={null}
{
    "result": "SUCCESS",
    "data": [/* list of bank transactions */],
    "error": [],
    "cursor": {
        "after": "eyJBRlRFUiI6ImJ0bl8xNjkifQ==",
        "before": "eyJCRUZPUkUiOiJidG5fMTg2MTAifQ=="
    }
}
```

## Paginate Forward or Backward

Use the `cursor.after` value to fetch the next page, or `cursor.before` to fetch the previous page. Include the appropriate cursor value in your next request.

```bash theme={null}
curl -X POST https://sandbox.tight.com/v6/banks/transactions/query \
-H 'Authorization: Bearer <access_token>' \
-D '{
        "limit": 100,
        "cursor": "eyJCRUZPUkUiOiJidG5fMTg2MTAifQ=="
    }'
```

<Check>
  If the response contains `cursor.after: null`, you have reached the last page. If `cursor.before: null`, you are on the first page.
</Check>

## Sort and Jump to a Specific Page

To sort results, add a `sorts` parameter. To jump to a specific spot, use the `start` property within `sorts`.

```bash theme={null}
curl -X POST https://sandbox.tight.com/v6/banks/transactions/query \
-H 'Authorization: Bearer <access_token>' \
-D '{
        "limit": 100,
        "sort": [{
            "orderBy": "description",
            "direction": "ASC",
            "start": "B"
        }],
    }'
```

<Tip>
  Cursor-based pagination is ideal for building user experiences where users can page forward, page backward, sort, and jump to specific pages from any page.
</Tip>
