PitchAPIDocumentationEvents

Events API

The narrative of the match, separate from the shot data that explains it.

GET /v1/matches/{id}/events returns the timeline: goals, cards, substitutions and penalties, in order, with the minute and the players involved. It is the endpoint for a match report, a commentary feed or a timeline widget.

Shots are deliberately not events. A shot is a data point with coordinates and a model value, and it lives on the shots endpoint; this one is the story around it. Building a timeline of attempts from events will not work, and building a shot map from events will not either.

The period field is derived from the minute rather than reported by the source. Treat it as a convenience around half time, not as an authority on stoppage time.

Data model

Events

The match timeline with four event types: goals, cards, substitutions, and penalties. Shots are not here — use the shots endpoint for shot data and this one for the narrative.

The period field is derived from the minute, not reported by upstream. Treat it as a convenience around half time.

goalA goal, with the running score and own-goal / penalty flags.
substitutionA substitution. player comes off, sub_in_player comes on.
yellowcardA yellow card.
redcardA red card (straight red or second yellow).
API reference

Endpoint

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

GET/v1/matches/{id}/events

List events

Goals, cards, subs, and penalties in order, each with the running score at that moment. `period` is inferred from the minute, not reported by upstream, so treat it as a convenience.

Auth API keyResponse JSON
idstringrequired

Match ID, for example m_B8x2K9

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

Common questions

Why are shots missing from the events list?
Shots are a separate resource with their own coordinates and xG. Use /v1/matches/{id}/shots for attempts and this endpoint for goals, cards, substitutions and penalties.
Is the period reliable in stoppage time?
It is derived from the minute, so treat it as a convenience. The minute and the added time are the fields to display; the period is for grouping.
Something missing or wrong? That is a bug in the docs.Get a free key
On this page