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

# Pagination

> Pagination: Set Aside Money developer API reference.

List endpoints that can return a lot of rows are paginated. Today that is `/v1/transactions`.

## Parameters

| Parameter | Default | Maximum |
| - | - | - |
| `page` | `1` | no limit |
| `limit` | `50` | `200` |

A `limit` above 200 is a `400` with `param: "limit"`, not a silent clamp. Silently returning fewer
rows than asked for is how pagination bugs go unnoticed for months.

## Response

```json theme={null}
{
  "data": [ { "id": "…", "concept": "Coffee", "amount": -1250 } ],
  "total": 1284,
  "page": 1,
  "pages": 26
}
```

`total` is the number of rows matching your filters, not the page size.

## Reading everything

```js theme={null}
async function* allTransactions(params = {}) {
  let page = 1;
  let pages = 1;

  do {
    const query = new URLSearchParams({ ...params, page, limit: 200 });
    const response = await fetch(`https://api.setaside.money/v1/transactions?${query}`, {
      headers: { Authorization: `Bearer ${process.env.SETASIDE_API_KEY}` },
    });
    if (!response.ok) throw new Error(`HTTP ${response.status}`);

    const body = await response.json();
    pages = body.pages;
    yield* body.data;
    page += 1;
  } while (page <= pages);
}

for await (const transaction of allTransactions({ from: "2026-01-01" })) {
  console.log(transaction.concept, transaction.amount / 100);
}
```

At 200 per page you can read 12,000 transactions inside one minute's burst allowance.

Filter before you page. Narrowing with `from` and `to` is far cheaper than paging through
everything and filtering in your own code, and it keeps you comfortably inside the rate limits. A
year of transactions for most accounts is a handful of pages.

## Ordering and stability

Results are ordered by `booked_at` descending, then by `id` descending. The `id` tiebreak means the
order is stable across pages when several transactions share a date, so paging cannot skip or repeat
a row that would otherwise sort ambiguously.

New transactions arriving mid-pagination still shift things, as they would in any offset-paged API.
For a long backfill, pass a `to` date so the window you are reading cannot grow underneath you.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.