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

# Pagination

> Use page and limit query parameters on list endpoints.

List endpoints that support pagination use `page` and `limit` query parameters.

```http theme={null}
GET /v1/posts?page=1&limit=25
```

## Query parameters

| Parameter | Description                                                          |
| --------- | -------------------------------------------------------------------- |
| `page`    | One-based page number. Defaults vary by endpoint, commonly `1`.      |
| `limit`   | Number of items to return. Defaults vary by endpoint, commonly `10`. |

## Response shape

Paginated responses use the existing YALG resource shape for the endpoint, typically with an item array and pagination metadata:

```json theme={null}
{
  "posts": [],
  "total": 0,
  "page": 1,
  "totalPages": 0
}
```

The item array name depends on the resource, such as `posts`, `anecdotes`, or another domain-specific collection.
