Skip to content
datasportsAPI

TeamsTeam season statistics

Documentation

/

Type to filter the docs by title or path.

TeamsEndpoint 35 of 116

Team season statistics

GET

/v2/teams/{id}/statistics

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

  • 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

  • typequeryOptional

    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

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.

data
TeamSeasonStatistics
meta
league, season, type (as applied)
Example response
{ "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

  • 400bad_request

    league or season is absent, or type is something other than overall, home, away, regularSeason or playoffs

  • 404no_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 key can also meet401unauthorized429rate_limited429quota_exceeded500internal_errorEvery error code