> ## 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 paginates 30 elements per response from List endpoints, using the `Link` header per the RFC standard.

<Note>
  The `Link` header has **nothing to do** with **Fintoc Links**. It is just an unfortunate name collision.
</Note>

## Pagination in v1

The `/v1` namespace uses offset pagination. The `Link` header supports the `next`, `last`, `first`, and `prev` relations:

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

## Pagination in v2

The `/v2` namespace uses cursor-based pagination, supporting only `next` navigation:

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

An empty `Link` header indicates that there are no additional pages.

## Automatic pagination

The Python and Node SDKs support automatic pagination:

```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
```

```javascript 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
}
```

## Other libraries

Libraries for parsing `Link` headers include Python's `requests`, Ruby's `Nitlink`, and JavaScript's `parse-link-header`.
