PitchAPIDocumentationPlayer stats

Player stats API

Every player who featured, with the stats grouped by phase of play and split by half where you need it.

GET /v1/matches/{id}/players returns one line per player who appeared. The line is an array of stat groups — top_stats for everyone, plus attack, defense and duels for outfielders, with goalkeeping figures inside top_stats instead. Read each group by its inner key, which is stable, not its display label, which may change.

Each value carries a type that says how to read it: a number, a percentage, a string. Parse the type rather than guessing from the label. Groups that do not apply to a position are absent, which is different from a group of zeroes.

The per-half endpoints go further: they count each player's contribution in the first and second half from the event feed. One player's shots live on the shots page, with the same fields as the match shot map. Half splits exist because the match total hides the substitution, the red card and the change of shape.

Data model

Player stats

Each stat line is an array of groups. Read entries by their inner key field, not the display label — the key is stable across matches, the label may change.

Which groups appear depends on position and involvement. Every player who featured gets top_stats. Outfielders also get attack, defense, and duels. Goalkeepers get shot-stopping figures inside top_stats instead.

GroupAppears onContains
top_statsEvery stat lineRating, minutes, goals, assists, xG, and xA. Present for every player who featured.
attackOutfieldersTouches, dribbles, crosses, passes into the final third, and non-penalty xG. Outfielders only.
defenseOutfieldersClearances, interceptions, recoveries, tackles, blocks, and times dribbled past. Outfielders only.
duelsOutfieldersAerial and ground duels, fouls committed, and fouls won. Outfielders only.
physical_metricsRarely availableDistance covered, sprints, and top speed. From tracking data.
Value shapes: branch on stat.type
integer
A whole number (goals, touches, clearances).
double
A decimal number (ratings, xG).
fractionWithPercentage
A made-attempted pair (accurate passes, duels won). Carries both value and total.
distanceWithPercentage
Metres covered out of a total distance (running splits).
distance
A distance in metres.
speed
A speed in km/h.
fantasyPoints
A fantasy football score.
boolean
A presence flag, not a measurement. Skip it when parsing.
API reference

Endpoints

Every request takes an X-API-KEY header and returns the JSON envelope described on the overview.

GET/v1/matches/{id}/players

List player stats

Per-player stats grouped by category. Which groups appear depends on position and involvement. Read stats by `stat.key`, not the label. When parsing, check `stat.type`: integer and double carry a `value`, fraction types also carry a `total`.

Auth API keyResponse JSON
idstringrequired

Match ID, for example m_B8x2K9

curl https://api.pitchapi.dev/v1/matches/{id}/players \
  -H "X-API-KEY: $PITCH_KEY"
GET/v1/matches/{id}/players/{player_id}

Retrieve a player's match stats

The stat line for one player. Same grouped shape as the list endpoint.

Auth API keyResponse JSON
idstringrequired

Match ID, for example m_B8x2K9

player_idstringrequired

Player ID, for example p_7YtX4q

curl https://api.pitchapi.dev/v1/matches/{id}/players/{player_id} \
  -H "X-API-KEY: $PITCH_KEY"
GET/v1/matches/{id}/players/halves

List player stats per half

Every player's stat line for the first and the second half. Each half's stats has the grouped shape of the list endpoint, though not every stat is available per half — the rating, for one, is match-level only. periods lists only the halves a player took part in, so a half-time substitute has just SecondHalf. Extra time belongs to neither half, and the halves need not add up exactly to the match line. Returns HALVES_UNAVAILABLE for a match we hold without per-half player stats.

Auth API keyResponse JSON
idstringrequired

Match ID, for example m_B8x2K9

curl https://api.pitchapi.dev/v1/matches/{id}/players/halves \
  -H "X-API-KEY: $PITCH_KEY"
GET/v1/matches/{id}/players/{player_id}/halves

Retrieve a player's stats per half

The halves of one player: the same object as an entry of the list endpoint, with the match ID. A player who took no part in a match that has halves returns RESOURCE_NOT_FOUND, which is distinct from HALVES_UNAVAILABLE for a match that has none.

Auth API keyResponse JSON
idstringrequired

Match ID, for example m_B8x2K9

player_idstringrequired

Player ID, for example p_7YtX4q

curl https://api.pitchapi.dev/v1/matches/{id}/players/{player_id}/halves \
  -H "X-API-KEY: $PITCH_KEY"
Questions

Common questions

Why do two players have different stat groups?
Groups depend on position and involvement. Every player gets top_stats; outfielders add attack, defense and duels; goalkeepers carry shot-stopping figures inside top_stats. A missing group means it does not apply, not that the values are zero.
Do player totals add up to the team totals?
Not always. Some team events belong to no player — a foul drawn is counted for the side and for nobody's individual line — so a sum of player figures can fall short of the team figure by design.
Something missing or wrong? That is a bug in the docs.Get a free key
On this page