TeamsEndpoint 35 of 116
Team season statistics
https://api.datasportsapi.com/
- Plan
- All plans
- Auth
Bearer dsa_live_…- Parameters
- 3 required · 1 optional
- Returns
TeamSeasonStatistics
Season totals and averages for a team within a single league — goals for and against, shots, possession, rating, clean sheets and more.
Worth knowing
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.
01Parameters
idpathRequiredDataSportsAPI team id, a positive integer
leaguequeryRequiredleague id — for example, the league of one of the team’s fixtures
seasonqueryRequiredseason id, as listed by /v2/leagues/{id}/seasons
typequeryOptionaloverall \| 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
02Request
The same call from the command line and each SDK. The SDK lines assume a client created with your key; left out, it is read from DATASPORTSAPI_API_KEY. Installing a client: SDKs & CLI.
curl -H "Authorization: Bearer dsa_live_…" \
"https://api.datasportsapi.com/v2/teams/{id}/statistics?league=…&season=…"03Response
The top-level keys of the JSON body. Each object links to its full shape in the data reference.
dataTeamSeasonStatisticsmeta- league, season, type (as applied)
{ "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" } }04Errors
- 400
bad_requestleague or season is absent, or type is something other than overall, home, away, regularSeason or playoffs
- 404
no_datano statistics exist at the source for this combination of team, league, season and type (an id DataSportsAPI never assigned gives 404 not_found instead)
- 404
not_foundthe season id does not belong to this league; the error message names the offending parameter, and /v2/leagues/{id}/seasons lists the valid ones
unauthorized429rate_limited429quota_exceeded500internal_errorEvery error code