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

# Parquet files (tick-level)

> Download whole games as parquet: every tick, every event, grenade paths.

`GET /v1/games/{game}/files` (10 units) lists the game's parquet files with signed download links:

```json theme={null}
{
  "data": [
    {"kind": "ticks", "part": 0, "bytes": 34078123, "description": "every player at every tick, ~79 fields",
     "url": "https://api.granuleux.com/v1/download/MjM5ODcy...", "expires_at": "2026-11-28T12:15:00Z"}
  ],
  "meta": {"data_version": 1}
}
```

* Links are valid for **15 minutes** (`expires_at`) and need no key. An expired or altered link returns `403`; call
  `/files` again for new ones.
* Downloads are served as `<game_id>-<kind>[-p<part>].parquet`. If `url` is a path starting with `/`, prefix the API
  base URL.
* Not every game has every kind. `has_ticks` on the game tells you whether the tick-level files exist.

## Kinds

| `kind` | One file per | Typical size | Contents |
| - | - | - | - |
| `ticks` | part | \~20-45 MB | Every player at every tick, 79 columns |
| `events` | part | \~1 MB | Every game event (except chat and camera), one wide table with an `event` column, \~110 sparse columns |
| `grenades` | part | \~1.5 MB | Every grenade projectile at every tick in flight |
| `state` | game | \~1 MB | The player state served by `/states`, all rounds |
| `state_ev` | game | \~35 KB | Kills, damage, grenade starts and ends, bomb events with Steam IDs and positions |
| `pbp` | game | \~40 KB | Play-by-play: one row per event plus a 1 Hz heartbeat, with team totals and round labels |

Most games are a single recording, so `part` is `0`; a game recorded in several parts has `ticks`, `events` and
`grenades` files numbered `1`, `2`, ... per part. `part` is `null` for the per-game kinds.

### ticks

One row per player per tick, including freeze time, warmup and any knife round (`is_warmup_period`,
`is_freeze_period`, `round_in_progress` tell them apart). There is no round number column: assign rounds with the
`freeze_end_tick` / `end_tick` windows from `GET /v1/games/{game}/rounds`.

| Group | Columns |
| - | - |
| Identity | `tick`, `steamid`, `name`, `team_num` (2 = T, 3 = CT), `team_clan_name`, `is_connected` |
| Position and view | `X`, `Y`, `Z`, `pitch`, `yaw`, `velocity_X`, `velocity_Y`, `velocity_Z` |
| Keys | `FORWARD`, `BACK`, `LEFT`, `RIGHT`, `FIRE`, `RIGHTCLICK`, `RELOAD`, `USE`, `JUMP`, `INSPECT` |
| Movement | `is_walking`, `ducking`, `duck_amount`, `is_airborne` |
| Health | `is_alive`, `health`, `armor_value`, `has_helmet`, `has_defuser` |
| Weapons | `active_weapon_name`, `active_weapon_ammo`, `total_ammo_left`, `inventory`, `is_scoped`, `zoom_lvl`, `shots_fired` |
| Money | `balance`, `start_balance`, `cash_spent_this_round`, `total_cash_spent`, `current_equip_value`, `equipment_value_this_round` |
| Status | `flash_duration`, `flash_max_alpha`, `is_defusing`, `last_place_name`, `in_bomb_zone`, `which_bomb_zone`, `in_buy_zone`, `spotted`, `approximate_spotted_by` |
| Running totals | `kills_total`, `deaths_total`, `assists_total`, `headshot_kills_total`, `damage_total`, `utility_damage_total`, `enemies_flashed_total`, `mvps`, `score` |
| Round state | `total_rounds_played`, `team_rounds_total`, `round_start_time`, `is_freeze_period`, `is_warmup_period`, `round_in_progress`, `round_win_status`, `round_win_reason`, `is_bomb_planted`, `is_bomb_dropped`, `ct_losing_streak`, `t_losing_streak`, `is_terrorist_timeout`, `is_ct_timeout`, `game_time` |

Column names follow the game's own field names, not the API: `X` rather than `x`, `health` rather than `hp`.

### events

Raw game events with the game's field names (`event`, `tick`, `user_steamid`, `attacker_steamid`,
`assister_steamid`, `weapon`, `dmg_health`, `hitgroup`, ...). Steam IDs are strings here. Most rows are
`player_sound`; filter on `event`.

### grenades

`tick`, `grenade_type`, `grenade_entity_id`, `steamid` (thrower), `name`, `x`, `y`, `z`. Group by
`grenade_entity_id` for one projectile's path.

### state\_ev

`round`, `tick`, `event` (game event name: `player_death`, `player_hurt`, `smokegrenade_detonate`, ...), `user`,
`user_side`, `attacker`, `weapon`, `dmg`, `hitgroup`, `headshot`, `x`, `y`, `z`.

> [!WARNING]
>
> In `state_ev`, `attacker` Steam IDs are rounded to a multiple of 16 (a float64 step upstream); `user` ids are exact.
> Snap each `attacker` to the nearest Steam ID in the game's roster (within 16). The API's `/kills` and `/damage` already
> do this.

## Reading the files

```python theme={null}
import os, requests

API = "https://api.granuleux.com"
H = {"Authorization": f"Bearer {os.environ['CS2API_KEY']}"}
files = requests.get(f"{API}/v1/games/2398724:1/files", headers=H).json()["data"]

paths = []
for f in files:
    url = f["url"] if f["url"].startswith("http") else API + f["url"]
    name = f"23987241-{f['kind']}" + (f"-p{f['part']}" if f["part"] is not None else "") + ".parquet"
    with requests.get(url, stream=True) as r, open(name, "wb") as out:   # no key needed
        r.raise_for_status()
        for chunk in r.iter_content(1 << 20):
            out.write(chunk)
    paths.append(name)
```

```python pandas theme={null}
import pandas as pd
ticks = pd.read_parquet("23987241-ticks-p0.parquet",
                        columns=["tick", "steamid", "X", "Y", "Z", "yaw", "pitch", "health", "is_alive"])
```

```python polars theme={null}
import polars as pl
ticks = (pl.scan_parquet("23987241-ticks-p0.parquet")
           .filter(pl.col("is_alive"))
           .select("tick", "steamid", "X", "Y", "yaw", "health")
           .collect())
```

```python duckdb theme={null}
import duckdb
duckdb.sql("""
    SELECT steamid, count(*) AS ticks_alive, avg(health) AS avg_hp
    FROM '23987241-ticks-p0.parquet'
    WHERE is_alive AND NOT is_warmup_period
    GROUP BY steamid
""").show()
```

Read only the columns you need: the files are columnar, so this is much faster and uses far less memory.


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