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

# Pagination

> Navigate through large result sets with cursor-based pagination. Learn how to use next page tokens to retrieve all results from KonbiniAPI endpoints.

All list endpoints use **cursor-based pagination**. This ensures consistent results even when the underlying data changes between requests.

## Parameters

| Parameter | Type    | Description                                        |
| --------- | ------- | -------------------------------------------------- |
| `cursor`  | string  | Cursor for the next page. Omit for the first page. |
| `count`   | integer | Number of items per page.                          |

## Response fields

Paginated responses use the `OrderedCollectionPage` type:

```json theme={null}
{
  "@context": ["https://www.w3.org/ns/activitystreams#", "https://konbiniapi.com/ns/social#"],
  "type": "OrderedCollectionPage",
  "partOf": "https://api.konbiniapi.com/v1/tiktok/users/example/videos",
  "totalItems": 342,
  "cursor": "abc123",
  "nextCursor": "def456",
  "next": "https://api.konbiniapi.com/v1/tiktok/users/example/videos?cursor=def456&count=30",
  "itemCount": 30,
  "orderedItems": [...]
}
```

| Field          | Description                                                                |
| -------------- | -------------------------------------------------------------------------- |
| `totalItems`   | Total number of items in the collection (may be `null` for some endpoints) |
| `itemCount`    | Number of items in this page                                               |
| `nextCursor`   | Cursor for the next page, `null` if there are no more pages                |
| `next`         | Pre-built URL to fetch the next page                                       |
| `orderedItems` | The items in this page                                                     |

## Iterating through pages

Use the `next` URL directly, or pass `nextCursor` as the `cursor` parameter in your next request. When `nextCursor` is `null`, you've reached the last page.

```bash theme={null}
# First page
curl "https://api.konbiniapi.com/v1/tiktok/users/example/videos?count=30" \
  -H "Authorization: Bearer knbn_your_api_key"

# Next page (using nextCursor from previous response)
curl "https://api.konbiniapi.com/v1/tiktok/users/example/videos?cursor=def456&count=30" \
  -H "Authorization: Bearer knbn_your_api_key"
```
