PitchAPIDocumentationTeams & players

Teams and players API

The two reference records every other response points at.

Match responses already carry the teams and the players involved, but sometimes a client holds an ID and nothing else. GET /v1/teams/{id} and GET /v1/players/{id} resolve those IDs to a name, an image and the record behind it.

IDs are opaque and prefixed by type — t_ for a team, p_ for a player — and they are not numeric or sortable. Do not parse them; store them. The same ID appears in match summaries, lineups, shots and the advanced endpoints, so one lookup serves every response that mentions the team.

These are reference endpoints, not search. There is no name lookup: resolve a team or player from a match, a lineup or a league's matches, then keep the ID.

API reference

Endpoints

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

GET/v1/teams/{id}

Retrieve a team

A team's name and image URL.

Auth API keyResponse JSON
idstringrequired

Team ID, for example t_9aB2xQ

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

Retrieve a player

A player's name, shirt number, position, country, and image URL.

Auth API keyResponse JSON
idstringrequired

Player ID, for example p_7YtX4q

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

Common questions

Can I search for a team by name?
Not through these endpoints. Resolve the team from a match, a lineup or a league's matches and keep the ID. The league catalogue is the closest thing to a directory.
Are team and player IDs stable?
Yes. They are opaque and prefixed by type, and the same ID is used everywhere the team or player appears, across seasons.
Something missing or wrong? That is a bug in the docs.Get a free key
On this page