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.
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.
The team's id, like team_…. Find one with the ID guide.
The season you want numbers for.
The team's id.
The season the numbers cover.
The competition that season belongs to.
Matches played.
Matches won.
Matches drawn.
Matches lost.
Points earned.
Place in the table.
Goals scored.
Goals conceded.
goals_for minus goals_against.
Results of the latest finished matches that season, up to five letters: W, D or L.
xG created, summed over the matches in xg_matches. Null when none of them has xG, for example in a competition without xG coverage.
xG conceded, summed over the matches in xg_matches. Null when none of them has xG.
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"
const res = await fetch("https://api.soccer-data.co/v1/teams/team_f0ibhxdw7hs5/stats?season_id=season_98l95mxugqs9", {
headers: { "X-Api-Key": process.env.SOCCER_DATA_KEY },
});
const { data } = await res.json();
import os, requests
res = requests.get(
"https://api.soccer-data.co/v1/teams/team_f0ibhxdw7hs5/stats",
params={"season_id": "season_98l95mxugqs9"},
headers={"X-Api-Key": os.environ["SOCCER_DATA_KEY"]},
)
data = res.json()["data"]
$data = Http::withHeaders(['X-Api-Key' => env('SOCCER_DATA_KEY')])
->get('https://api.soccer-data.co/v1/teams/team_f0ibhxdw7hs5/stats', ['season_id' => 'season_98l95mxugqs9'])
->json('data');
{
"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 /teams/{team_id}/stats
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.
- 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.
Query parameters:
- `season_id` (string, required): The season you want numbers for.
Response fields:
- `data.team_id` (string): The team's id.
- `data.season_id` (string): The season the numbers cover.
- `data.competition_id` (string): The competition that season belongs to.
- `data.matches_played` (integer): Matches played.
- `data.wins` (integer): Matches won.
- `data.draws` (integer): Matches drawn.
- `data.losses` (integer): Matches lost.
- `data.points` (integer): Points earned.
- `data.position` (integer): Place in the table.
- `data.goals_for` (integer): Goals scored.
- `data.goals_against` (integer): Goals conceded.
- `data.goal_difference` (integer): goals_for minus goals_against.
- `data.form` (string): Results of the latest finished matches that season, up to five letters: W, D or L.
- `data.expected_goals_for` (number): 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_against` (number): xG conceded, summed over the matches in xg_matches. Null when none of them has xG.
- `data.xg_matches` (integer): How many matches the xG totals are based on.
Example: curl "https://api.soccer-data.co/v1/teams/team_f0ibhxdw7hs5/stats?season_id=season_98l95mxugqs9" -H "X-Api-Key: $SOCCER_DATA_KEY"