# GET /v2/teams/{id}/statistics

Group: Teams

Season totals and averages for a team within a single league — goals for and against, shots, possession, rating, clean sheets and more.

Plans: Every plan, Free included.

Note: 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

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | DataSportsAPI team id, a positive integer |
| `league` | query | yes | league id — for example, the league of one of the team’s fixtures |
| `season` | query | yes | season id, as listed by /v2/leagues/{id}/seasons |
| `type` | query | no | 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

- `data`: `TeamSeasonStatistics`
- `meta`: league, season, type (as applied)
- Objects: TeamSeasonStatistics (https://datasportsapi.com/markdown/reference.md#teamseasonstatistics)

## Errors

- 400 bad_request — league or season is absent, or type is something other than overall, home, away, regularSeason or playoffs
- 404 no_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)
- 404 not_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

Plus the common errors (https://datasportsapi.com/markdown/docs.md#errors).

## Request

cURL:

```bash
curl -H "Authorization: Bearer sk_live_…" \
    "https://api.datasportsapi.com/v2/teams/{id}/statistics?league=…&season=…"
```

TypeScript:

```ts
const { data, meta } = await client.teams.statistics(id, { league, season });
```

Python:

```python
res = client.teams.statistics(id, league=league, season=season)
```

Go:

```go
res, err := client.Teams.Statistics(ctx, id, &datasportsapi.TeamsStatisticsParams{League: league, Season: season})
```

CLI:

```bash
$ dsa teams statistics <id> --league <league> --season <season>
```

## Example response

```json
{ "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" } }
```

---

Base URL: https://api.datasportsapi.com. Authenticate each /v2 call with the header `Authorization: Bearer <key>` (secret keys begin with `sk_live_`).
HTML: https://datasportsapi.com/docs/teams/statistics/ · All docs: https://datasportsapi.com/markdown/docs.md · Data reference: https://datasportsapi.com/markdown/reference.md
