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

Group: Teams

The team’s season statistics in one league: totals and averages (goals scored and conceded, shots, possession, rating, clean sheets, …).

Note: Keys follow the match statistics’ vocabulary (totalShots, shotsOnGoal, cornerKicks, passes, averageRating, …) with an Against twin for the opponents’ figures; a 0 matches beside non-zero counts is left out.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | our numeric id (positive integer) |
| `league` | query | yes | a league id (e.g. the team’s fixtures’ league) |
| `season` | query | yes | a season id from /v2/leagues/{id}/seasons |
| `type` | query | no | overall \| home \| away \| regularSeason \| playoffs. Default: the season’s own — overall where it has one (football), else regularSeason (NBA, NHL, …); meta.type says which was used |

## Response

- `data`: `TeamSeasonStatistics`
- `meta`: league, season, type (the one used)
- Objects: TeamSeasonStatistics (https://sportsapi.app/markdown/en/reference.md#teamseasonstatistics)

## Errors

- 400 bad_request — missing league or season, type not one of overall, home, away, regularSeason, playoffs
- 404 no_data — the source has no statistics for that team, league, season and type (404 not_found: an id we never issued)
- 404 not_found — season is not one of this league’s seasons (the message names the parameter; list them with /v2/leagues/{id}/seasons)

Plus the common errors (https://sportsapi.app/markdown/en/docs.md#errors).

## Request

cURL:

```bash
curl -H "Authorization: Bearer sk_live_…" \
    "https://api.sportsapi.app/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, &sportsapi.TeamsStatisticsParams{League: league, Season: season})
```

CLI:

```bash
$ sportsapi 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.sportsapi.app. Send your API key as `Authorization: Bearer <key>` on every /v2 request; keys are created in the dashboard (https://sportsapi.app/dashboard).
HTML: https://sportsapi.app/docs/teams/statistics · All docs: https://sportsapi.app/markdown/en/docs.md
