# Pagination

How list and search operations on the Assyro API paginate: page numbers for search, cursors for catalogs.

Source: https://www.assyro.com/docs/pagination

> **Note:** Preview: `api.assyro.com` is not serving production data yet. Requests and responses on this page follow the published contract and may change before launch.

Operations that return lists paginate from the first page; none returns an unbounded list. Each response says how it paginates in `page.consistency`.

## Search: page numbers

Search operations take `page` (from 1) and `pageSize`. For the next page, send the same input with `page` + 1. Keep every filter and the page size the same between pages; `page.hasNextPage` is false on the last page.

## Catalogs: cursors

Catalog operations take `limit` and `cursor` (null for the first page). For the next page, send `page.nextCursor` as `cursor`. A cursor belongs to the request that produced it: reusing it with other inputs is `invalid_cursor`, and an old one is `cursor_expired`.

### The page object

| Field | Type | Required | Description |
|---|---|---|---|
| `itemsReturned` | integer | yes | How many items this response holds. |
| `total` | integer or null | yes | The total number of matches, when known. |
| `totalRelation` | string | yes | `exact`, `lower-bound` (there are at least this many) or `unknown` (then `total` is null). |
| `hasNextPage` | boolean | yes | Whether another page follows. |
| `nextCursor` | string or null | yes | The cursor for the next page of a catalog; null for search and on the last page. |
| `consistency` | string | yes | `live-offset` for page-number pagination, `live-keyset` or `snapshot-bound` for cursors. |
