Building with AI? Give your coding tool the whole reference in one file: https://soccer-data.co/llms.txt
SOCCER DATA Docs
Sign in Get API key
// Teams

Team season record

Returns a team's results, goals, table position, recent form and expected goals for one season. Use it for a team summary card or to compare sides over a season.

GET https://api.soccer-data.co/v1/teams/{team_id}/stats
  • season_id is required. Leaving it out returns 400 BAD_REQUEST.
  • Get season ids from /competitions/{competition_id}/seasons, or take current_season_id from the competition.
  • Returns 404 NOT_FOUND when the team has no stats for that season.
  • The xG totals only add up the matches counted in xg_matches, which can be fewer than matches_played. Check both before comparing teams.
Path parameters
team_idstringrequired

The team's id, like team_…. Find one with the ID guide.

Query parameters
season_id string required

The season you want numbers for.

Response fields
data.team_idstring

The team's id.

data.season_idstring

The season the numbers cover.

data.competition_idstring

The competition that season belongs to.

data.matches_playedinteger

Matches played.

data.winsinteger

Matches won.

data.drawsinteger

Matches drawn.

data.lossesinteger

Matches lost.

data.pointsinteger

Points earned.

data.positioninteger

Place in the table.

data.goals_forinteger

Goals scored.

data.goals_againstinteger

Goals conceded.

data.goal_differenceinteger

goals_for minus goals_against.

data.formstring

Results of the latest finished matches that season, up to five letters: W, D or L.

data.expected_goals_fornumber

xG created, summed over the matches in xg_matches. Null when none of them has xG, for example in a competition without xG coverage.

data.expected_goals_againstnumber

xG conceded, summed over the matches in xg_matches. Null when none of them has xG.

data.xg_matchesinteger

How many matches the xG totals are based on.

curl "https://api.soccer-data.co/v1/teams/team_f0ibhxdw7hs5/stats?season_id=season_98l95mxugqs9" \
  -H "X-Api-Key: $SOCCER_DATA_KEY"
200 · Example response
{
    "data": {
        "team_id": "team_f0ibhxdw7hs5",
        "season_id": "season_98l95mxugqs9",
        "competition_id": "competition_705uv6jm8myn",
        "matches_played": 38,
        "wins": 26,
        "draws": 7,
        "losses": 5,
        "points": 85,
        "position": 1,
        "goals_for": 71,
        "goals_against": 27,
        "goal_difference": 44,
        "form": "WWWWW",
        "expected_goals_for": 18.42,
        "expected_goals_against": 11.07,
        "xg_matches": 9
    }
}
Get a free key to try it