The match is the anchor for everything else in the API. One GET /v1/matches/{id} returns the competition, both sides, the score, the status, the referee and the stadium; every other match endpoint takes that same m_ ID.
This page covers the summary itself, the team-versus-team statistics for each half, the head-to-head record between the two sides, and the heatmap grids. Use it when you already hold a match ID — from a date query, a league listing or a webhook. Starting from a date or a competition instead? Fixtures and leagues are the entry points. If the match is in play, the live endpoint is the one to poll.
Branch on status, not the score: score_home and score_away are null before kickoff. Dates are YYYY-MM-DD, and time_utc is RFC 3339 in UTC.
Team stats
Team-versus-team statistics for each half and the match as a whole. Values are display strings, so parse them with format_type. An empty format_type still holds a plain number.
The Expected goals group splits xG into open play and set play, which shot-level data does not provide. Groups come back in alphabetical order. For typed numeric analytics on the same match, use the advanced endpoints instead — those return numbers, not display strings.
integer- A whole number as a string.
integerWithPercentage- A count and its percentage in one string. The number precedes the space.
double- A decimal as a string.
distance- A distance in metres as a string.
""- An empty format_type but still a plain number.
Endpoints
Every request takes an X-API-KEY header and returns the JSON envelope described on the overview.
Retrieve a match
The match summary: league, teams, score, status, referee, and stadium.
idstringrequiredMatch ID, for example m_B8x2K9
curl https://api.pitchapi.dev/v1/matches/{id} \
-H "X-API-KEY: $PITCH_KEY"Retrieve team stats
Team-by-team totals per half and for the full match. Values are strings, so parse them with `format_type`. An empty `format_type` means a plain number. Groups come back in alphabetical order.
idstringrequiredMatch ID, for example m_B8x2K9
curl https://api.pitchapi.dev/v1/matches/{id}/stats \
-H "X-API-KEY: $PITCH_KEY"Retrieve head-to-head
Head-to-head history plus recent and upcoming meetings. Unplayed fixtures have null scores and `finished: false` — check `finished` before trusting a score.
idstringrequiredMatch ID, for example m_B8x2K9
curl https://api.pitchapi.dev/v1/matches/{id}/h2h \
-H "X-API-KEY: $PITCH_KEY"Retrieve team and player heatmaps
Where each side and each player acted, binned onto a 16 x 12 grid of the pitch. Two team grids, home first, then one grid per player who touched the ball, busiest first. Cells are sparse [cell_x, cell_y, actions] triples — a cell with no activity is absent rather than zero, which is most of the 192 — so expand to a dense grid yourself if you need one. Read grid.frame before plotting: in acting_ltr, cell_x 0 is the acting team's own goal line and 15 the opponent's, for both teams and in both halves. Each grid is therefore correct on its own pitch, but the two are not on a shared one. To draw both teams together, ask for frame=home_ltr and the server turns the away side for you — there is nothing to mirror client-side. Every team and player also carries side, home or away. grid.frame echoes the orientation actually served. actions is a raw count for the match and not per-90, so a substitute's grid is thinner than a starter's for reasons that are about minutes rather than involvement. This is match level: there is no season or cross-match aggregate. Returns ANALYTICS_UNAVAILABLE for a match we hold but never rated.
idstringrequiredMatch ID, for example m_B8x2K9
framestringacting_ltr (default) gives every team its own attacking frame, which is what makes a player comparable across home and away fixtures. home_ltr puts both teams on one pitch — home attacking cell_x 15, away attacking 0 — for a match view. The server applies the turn.
curl https://api.pitchapi.dev/v1/matches/{id}/heatmaps \
-H "X-API-KEY: $PITCH_KEY"Common questions
- How do I find a match ID?
- Ask for a date with
/v1/date/{date}or list a league's matches with/v1/leagues/{id}/matches. Both return IDs in them_form that every match endpoint accepts. A webhook delivery carries the same ID. - What is the difference between team stats and advanced analytics?
- Team stats are display strings split by half, with a
format_typethat says how to parse each value. The advanced endpoints return typed numbers on the same match, including metrics team stats do not carry. Use the advanced page when you need arithmetic rather than presentation.