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

# Game Data Overview

> Events, phases, possessions, physical summaries and tracking from match video.

> [!WARNING]
>
> The Game Data API is in preview. Endpoints, fields and limits may change before release, and it is not yet available to call.

The Game Data API returns what Uplift produces from match video: events, phases of play and possessions, physical summaries per player, and tracking for every player and the ball. It uses the same base URL, API keys, errors and conventions as the rest of the Uplift API.

## How it is organized

The API has two tiers:

* **Per game.** Each endpoint returns a whole game: events and segments a page at a time (a full match can have over 10,000 events), every player's physical summary in one response. Optional filters narrow the result. Tracking is returned one period at a time.
* **Across games.** [List Player Stats](https://docs.uplift.ai/api-reference/game-data/player-stats/list.md) aggregates physical and event totals per player, grouped by game or season.

To add a game, [create the game](https://docs.uplift.ai/api-reference/game-data/games/create.md), then [create a video](https://docs.uplift.ai/api-reference/game-data/videos/create.md) and upload it. When processing finishes, the game's data is available from the per-game endpoints.

## Key concepts

* **Game:** a match between two teams, with date, competition, pitch size, frame rate (`fps`), roster and each team's attacking direction per period. Each team has a stable `team_id` and a `team_side` of `home` or `away`.
* **Video:** a video file uploaded to a game. A game can be one full-match video or several (the halves, or parts of the match).
* **Run:** one processing pass over a game's videos. Every response includes the `run_id` it came from. Re-processing a game creates a new run and replaces the game's data.
* **Event:** an action in the game with a start and an end, such as a pass, a high-speed run or a duel. See the [event catalogue](https://docs.uplift.ai/api-reference/game-data/event-catalogue.md).
* **Segment:** a span of time, such as a phase of play, a team possession, a player possession or a key moment. Every event falls inside a phase of play and, when the ball is involved, a team possession and a player possession.
* **Player:** `player_id` identifies a roster entry in one game. It can be empty, or a placeholder such as `track_12`, when a player isn't identified. When it is linked to an Uplift athlete, `athlete_id` is included, so game data and capture data can be joined.

## How the data fits together

A game is made up of periods and built from the videos you upload. Inside a period, everything shares one timeline, `time_s`:

* **Tracking layers** are the raw positions. Player positions and the ball cover every frame (the ball has gaps when it is not seen). 3D skeletons are run only for key players during key moments.
* **Segments** are spans of time. Phases of play and dead balls cover the whole period. Team possessions sit inside play. Player possessions sit inside team possessions, back to back: each runs from a player's first touch until the next player's.
* **Events** have a start and an end. A touch is a single frame, a pass runs from the touch that plays it until the ball reaches the next player, and a high-speed run lasts a few seconds. Each event needs a tracking layer: `position`, `ball` or `skeleton`. It takes its `phase` and possession IDs from the segments it falls in.
* **Key moments** are laid over the top. They list their events and pick the players whose skeletons are run.

![A game split into periods and videos, zoomed into 60 seconds of period 1. Tracking layers for players, ball and skeleton sit above segments for phases of play, team possessions and player possessions, then events grouped by the layer they need, and a key moment overlay.](https://mintcdn.com/upliftlabs/zbMPbSTKPVShkAMF/images/game-data/game-data-layers-light.svg?fit=max\&auto=format\&n=zbMPbSTKPVShkAMF\&q=85\&s=8479e693b346985783f1a2cfc400de60)

One minute of period 1: tracking layers, segments and events on the same timeline.

## Conventions

* **Coordinates:** pitch metres with the origin at the centre spot, `x` along the length and `y` across; `z` is height for the ball. Event coordinates are turned so that the event's team attacks towards positive `x`; `attacking_side` says which way that team was attacking on the pitch. Tracking stays on the fixed pitch, with each team's attacking direction per period on the game.
* **Time:** `period` is 1 or 2 for halves, 3 or 4 for extra time and 5 for a penalty shootout; a single video is period 1. `time_s` is seconds from the start of the period; `frame` is the video frame.
* **Frame rate:** data is at the game's frame rate, given in `fps` on the game.
* **Naming:** every field, parameter and value is `snake_case`.
* **Paging:** List Game Events and List Game Segments return the game a page at a time, with `limit` (up to 2,000, default 1,000) and `offset`; `total_count` is the number matching. Every page includes `run_id`: if it changes between pages, the game was re-processed, so start again from `offset=0`. Physical summaries return the whole game, and tracking one period. List endpoints also use `limit` and `offset`: List Games returns up to 500 rows per page, List Player Stats up to 5,000.
* **Quality:** every event and segment has a `confidence` from 0 to 1, a `confidence_tier` (`high`, `medium` or `low`), and the `layer` it needs: `position` (player positions only), `ball` (the ball as well) or `skeleton` (3D body pose).
* **Formats:** responses are JSON. Tracking is a zstd-compressed Parquet file.

## Webhooks

Game data uses the existing [webhooks](https://docs.uplift.ai/guides/platform-configuration/setting-up-webhooks-in-the-uplift-platform.md):

* `game.processing_completed`: a run finished, the first time or after re-processing. The payload includes `game_id` and `run_id`.
* `game.processing_failed`: processing failed, with an error summary.


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