> ## Documentation Index
> Fetch the complete documentation index at: https://cs2-data-api.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Pagination

> Keyset cursors, page sizes and CSV.

Every JSON response has the shape `{"data": ..., "meta": {...}}`. `meta.data_version` identifies the data build.

## Paginated lists

These endpoints return a page and a cursor:

| Endpoint | Order | Default `limit` |
| - | - | - |
| `/v1/matches`, `/v1/teams/{team_id}/matches`, `/v1/tournaments/{tournament_id}/matches` | Newest match first | 50 |
| `/v1/games/{game}/kills`, `.../damage`, `.../grenades`, `.../bomb` | By `round_no`, then `seq` | 200 |
| `/v1/players` | Most recently seen first | 50 |
| `/v1/players/{steamid}/games` | Newest game first | 50 |
| `/v1/teams`, `/v1/tournaments` | Most recent first | 50 |

```json theme={null}
{
  "data": [ ... ],
  "meta": { "next_cursor": "WzE3NjA...", "limit": 200, "data_version": 1 }
}
```

Pass `meta.next_cursor` back as `cursor`, with the **same filters**, until it is `null`:

```python theme={null}
def fetch_all(path, params):
    params, out = dict(params), []
    while True:
        body = requests.get(f"{API}{path}", headers=H, params=params).json()
        out += body["data"]
        if not body["meta"]["next_cursor"]:
            return out
        params["cursor"] = body["meta"]["next_cursor"]

kills = fetch_all("/v1/games/2398724:1/kills", {"limit": 1000})
```

* `limit` accepts 1 to 1000, but is capped at your plan's maximum page size (200 without a plan, 1,000 on Hobby and Pro). `meta.limit` is the size
  actually used.
* Cursors are opaque. One the endpoint did not issue returns `400 Bad cursor`.
* Pagination is keyset-based, so pages stay consistent while you page; rows are not skipped or repeated.
* Each page is a separate call and costs units. Filter by `round` or `player_id` when you need less.

## Unpaginated lists

These return the whole list in one response (`meta` has only `data_version`): `/v1/games/{game}/rounds`,
`/v1/games/{game}/players`, `/v1/games/{game}/rounds/{round_no}/players`, `/v1/games/{game}/states` (one round, or a
tick range of at most 240 s), `/v1/games/{game}/files`, `/v1/maps`.

## CSV

Endpoints that list a `format` parameter return CSV with `format=csv`. Columns are the JSON fields; list and object
values are JSON-encoded in the cell.

CSV responses contain only rows, so the cursor moves to a response header: a paginated CSV page that has more rows
carries `X-Next-Cursor`. Pass it back as `cursor`, with the same filters and `format=csv`, until the header is absent.

```python theme={null}
import requests
url, params, parts = f"{API}/v1/players", {"sort": "name", "limit": 1000, "format": "csv"}, []
while True:
    r = requests.get(url, headers=H, params=params)
    parts.append(r.text if not parts else r.text.split("
", 1)[1])   # keep one header row
    if "X-Next-Cursor" not in r.headers:
        break
    params["cursor"] = r.headers["X-Next-Cursor"]
csv_text = "".join(parts)
```


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