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

# Pagination

> How pagination works across all list endpoints in the Rushed API.

## Parameters

All list endpoints support offset-based pagination:

| Parameter | Type    | Default | Range | Description                |
| --------- | ------- | ------- | ----- | -------------------------- |
| `limit`   | integer | 20      | 1–100 | Number of results per page |
| `offset`  | integer | 0       | 0+    | Number of results to skip  |

## Usage

```bash theme={null}
# First page (20 results)
curl "https://worker.rushed.com.br/api/articles?limit=20&offset=0" \
  -H "X-API-Key: rsh_live_xxx"

# Second page
curl "https://worker.rushed.com.br/api/articles?limit=20&offset=20" \
  -H "X-API-Key: rsh_live_xxx"
```

## Response format

Paginated endpoints include a `pagination` object:

```json theme={null}
{
  "success": true,
  "data": [ ... ],
  "pagination": {
    "limit": 20,
    "offset": 0,
    "total": 1847,
    "hasMore": true
  }
}
```

| Field     | Description                                   |
| --------- | --------------------------------------------- |
| `limit`   | Number of results requested                   |
| `offset`  | Current offset                                |
| `total`   | Total number of matching results              |
| `hasMore` | `true` if more results exist beyond this page |

## Iterating through all results

```python theme={null}
import requests

API_KEY = "rsh_live_xxx"
BASE = "https://worker.rushed.com.br/api/articles"

offset = 0
limit = 100
all_articles = []

while True:
    res = requests.get(
        f"{BASE}?limit={limit}&offset={offset}",
        headers={"X-API-Key": API_KEY}
    ).json()

    all_articles.extend(res["data"])

    if not res["pagination"]["hasMore"]:
        break

    offset += limit

print(f"Fetched {len(all_articles)} articles")
```

## Endpoints that support pagination

* `GET /api/articles`
* `GET /api/articles/by-sector/{sector}`
* `GET /api/articles/search`
* `GET /api/entities`
* `GET /api/entities/{id}/articles`
