Skip to main content
Use this page to find the IDs that every other endpoint needs.
Fastest way: ask your AI. Set up your coding tool once with Build with AI, then paste:
Prompt

How IDs work

IDs are strings with a prefix that tells you what they point to. You look them up by name with the requests below, then pass them to other endpoints.
Just need one ID? Use the ID finder in your dashboard (you need to be logged in).
The JavaScript examples run on your server and read your key from the THESTATSAPI_API_KEY environment variable.

Find a competition

Search by name. The best match comes first. Add sort=name if you want A to Z instead.
Response (trimmed):
Response
You can also filter instead of searching:
  • country_code=GB-ENG&type=league lists English leagues. GB returns every UK nation; GB-ENG, GB-SCT, GB-WLS and GB-NIR return one. Other countries use codes such as DE or ES.
  • country=Spain matches the country name.

Find the current season and past seasons

Fetch the competition to get current_season_id.
Response
For older seasons, list them. They come back newest first, and the current one has is_current: true.
Response
A season ID belongs to one competition. If you send a season_id with a different competition_id, you get a 400 error: “season_id does not belong to competition_id”.

Find a team (men’s or women’s)

Search by name. A club’s men’s and women’s teams often share a name, so check is_mens_team.
Response (trimmed):
Response
To get one side only, add is_mens_team=true (men) or is_mens_team=false (women). On a team, is_mens_team is null when it isn’t known.
To list every team in a season, filter by competition and season instead: /football/teams?competition_id=comp_3039&season_id=sn_8406098 returns the 20 Premier League teams.

Find a player

Search needs at least 3 characters. It ignores case and accents, so odegaard finds “Ødegaard”.
Response (trimmed):
Response
Other ways to find players:
  • /football/players?team_id=tm_9145 lists a team’s current players. Add position=F (or G, D, M) to narrow it.
  • /football/teams/tm_9145/players returns the squad with extra profile fields.
  • /football/players?player_ids=pl_45126714,pl_29627593 fetches several players in one call.

Find a match

Match IDs come from /football/matches. Filter by team, competition, season, date or status. For example, a team’s next fixture:
See Fixtures and results for every filter.

API reference