> ## 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.

# Rate limits

> Plans, units, map quotas and the RateLimit headers.

Each key has two limits: **requests per minute** and a **daily unit budget**. Detailed data is also metered by plan
(see [Plans](#plans)).

## Plans

| | No plan | Hobby | Pro |
| - | - | - | - |
| Requests / minute | 30 | 60 | 600 |
| Units / day | 2,000 | 20,000 | 1,000,000 |
| Max page size | 200 | 1,000 | 1,000 |
| Detailed data | Free sample match only | 250 maps a month, matches older than 180 days | Every match up to yesterday |
| `/files` | Sample match | Within the 250 maps | Up to 500 maps a day |
| `/v1/bulk` | No | No | Yes |

**Detailed data** is anything below the match and map level: rounds, kills, damage, grenades, bomb events, shots,
purchases, player and team state, per-game player stats and the parquet files. A map counts once the first time a key's
account opens any of it in a month (or, for Pro files, in a day); opening it again is free. Lists of matches, maps,
players, teams, tournaments, rosters and markets are not counted, and the free sample match never counts.

On Hobby (and without a plan), detailed datasets in `/v1/data` take one `game` or `match` per query. Errors:
`403 Plan required` (no plan), `403 Too recent for this plan` (Hobby, match under 180 days old), `429 Map quota used`.
Plans and trials: see the [pricing page](https://www.granuleux.com/pricing).

## Units

| Call | Units |
| - | - |
| `GET /v1/games/{game}/states` | 5 |
| `GET /v1/games/{game}/files` | 10 |
| Any other call | 1 |

`GET /v1/health` and the signed file download links are free and do not need a key. Each page of a paginated list is
a separate call. The daily budget resets at 00:00 UTC.

On Hobby, 20,000 units a day is, for example, about 90 maps of full player state through `/v1/data` (the 250-map monthly quota is usually the limit that matters).

## Headers

Authenticated responses carry:

| Header | Meaning |
| - | - |
| `RateLimit-Limit` | Your daily unit budget |
| `RateLimit-Remaining` | Units left today after this call |
| `RateLimit-Reset` | Seconds until the budget resets (00:00 UTC) |
| `Retry-After` | On `429` only: seconds to wait |

The per-minute limit is a token bucket: you can burst up to the per-minute number of requests, then requests refill
evenly over the minute. When it is empty you get `429 Too many requests` with a short `Retry-After`. When the daily
budget is spent you get `429 Daily quota used` with `Retry-After` set to the time until 00:00 UTC.

## Checking usage

`GET /v1/usage` (1 unit) returns your key's tier, limits, units used today and a per-endpoint breakdown for the last
`days` days (default 7, max 90).

```bash theme={null}
curl -H "Authorization: Bearer $CS2API_KEY" "https://api.granuleux.com/v1/usage?days=1"
```

## Staying inside the budget

* Use the event endpoints (`/kills`, `/damage`, `/grenades`, `/bomb`, 1 unit a page, up to 1,000 rows on Pro) when
  you do not need per-player state.
* Ask `/states` only for the columns you need with `fields=` (same 5 units, smaller responses).
* For whole games at full resolution, one `/files` call (10 units) gives the tick-level `ticks` file, which holds more than
  every `/states` round of the game combined.
* Responses for game data carry `Cache-Control: private, max-age=3600`; cache them on your side.


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