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

# Pagination

By default, Fintoc returns 30 elements per paginated response, such as responses from [List movements](/api/movements-api/movements/movements-list). The API includes pagination details in the [`Link` header](https://tools.ietf.org/html/rfc5988), following the [RFC 8288 standard](https://tools.ietf.org/html/rfc8288). The `Link` header is unrelated to Fintoc `Link` objects.

For each paginated request, the API returns the pagination information using the `Link` header. This header contains one or more URLs that direct to different pages.

## Pagination v1

Endpoints in the `/v1` namespace, such as [List links](/api/movements-api/links/links-list), use offset pagination. The `Link` header in this namespace lets you navigate to the next, previous, first, and last page:

```text Link Header theme={null}
Link: <https://api.fintoc.com/v1/links?page=1>; rel="first",
  <https://api.fintoc.com/v1/links?page=2>; rel="next"
```

The possible `rel` values are:

| Name    | Description                                              |
| :------ | :------------------------------------------------------- |
| `next`  | Link that leads to the **next page** of the resource     |
| `last`  | Link that leads to the **last page** of the resource     |
| `first` | Link that leads to the **first page** of the resource    |
| `prev`  | Link that leads to the **previous page** of the resource |

## Pagination in V2

Endpoints in the `/v2` namespace, such as [List Transfers](/api/transfers-api/transfers/transfers-list), use cursor-based pagination. In this namespace, the `Link` header only allows navigation to the next page in the list:

```text Link Header theme={null}
Link: <https://api.fintoc.com/v2/transfers?starting_after=tr_12334567>; rel="next"
```

The possible `rel` values are:

| Name   | Description                                          |
| :----- | :--------------------------------------------------- |
| `next` | Link that leads to the **next page** of the resource |

If `Link` is empty, it means there are no more pages.

## Automatic pagination

The [Node SDK](https://github.com/fintoc-com/fintoc-node) and [Python SDK](https://github.com/fintoc-com/fintoc-python) support automatic pagination. This feature allows you to iterate through large lists of resources without having to manually perform the requests to fetch subsequent pages:

```node Node theme={null}
import { Fintoc } from 'fintoc';

const client = new Fintoc('your_api_key');

const paymentIntents = await client.paymentIntents.list();
for await (const paymentIntent of paymentIntents) {
  // Do something with the paymentIntent
}
```

```python Python theme={null}
from fintoc import Fintoc

client = Fintoc("your_api_key")

payment_intents = client.payment_intents.all()
for payment_intent in payment_intents:
    # Do something with the payment intent

```

## Other libraries

If you use other languages or don't want to use our SDK, the following libraries parse the `Link` header so that you don't have to:

| Language   | Library                                                                             |
| :--------- | :---------------------------------------------------------------------------------- |
| Python     | [`requests`](https://requests.readthedocs.io/en/v3.0.0/user/advanced/#link-headers) |
| Ruby       | [`Nitlink`](https://github.com/alexpeattie/nitlink)                                 |
| JavaScript | [`parse-link-header`](https://github.com/thlorenz/parse-link-header)                |
