Team season statistics
GET
/
View as MarkdownTry in Playground →
Season totals and averages for a team within a single league — goals for and against, shots, possession, rating, clean sheets and more.
Keys use the same vocabulary as match statistics (totalShots, shotsOnGoal, cornerKicks, passes, averageRating, …), paired with an …Against variant that holds what opponents recorded. A matches value of 0 is dropped when the other counts are non-zero.
Parameters
idpathrequired
DataSportsAPI team id, a positive integer
leaguequeryrequired
league id — for example, the league of one of the team’s fixtures
seasonqueryrequired
season id, as listed by /v2/leagues/{id}/seasons
typequery
overall | home | away | regularSeason | playoffs. When omitted, the season’s native type applies: overall if the season has one (football), otherwise regularSeason (NBA, NHL, …); meta.type reports the one applied
Response
- meta
- league, season, type (as applied)
- errors
- 400
bad_request— league or season is absent, or type is something other than overall, home, away, regularSeason or playoffs404no_data— no statistics exist at the source for this combination of team, league, season and type (an id DataSportsAPI never assigned gives 404 not_found instead)404not_found— the season id does not belong to this league; the error message names the offending parameter, and /v2/leagues/{id}/seasons lists the valid ones
Any /v2 call can also come back with one of the common errors.
curl -H "Authorization: Bearer sk_live_…" \
"https://api.datasportsapi.com/v2/teams/{id}/statistics?league=…&season=…"Example
{ "data": { "statistics": { "matches": 7, "goalsScored": 19, "goalsConceded": 7, "totalShots": 112,
"averageBallPossession": 61.3, "averageRating": 7.02, "cleanSheets": 3, … } },
"meta": { "league": 195828, "season": 200386, "type": "overall" } }