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

Group: Teams

Where the team’s season statistics rank among its league’s teams: for each statistic its value, its place on the season total and its place per game (the NBA, the NFL and other leagues the source ranks).

Note: The keys are those of /v2/teams/{id}/statistics (basketball: points, rebounds, fieldGoalPercentage, netRating, …).

## 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 \| mainDraw (a tennis tournament’s main draw, without qualifying). Default: the season’s own — overall where it has one (football), else regularSeason (NBA, NHL, …); a tennis tournament’s leaderboards (top-players, top-teams, top-performances) default to mainDraw where it has one, else overall; meta.type says which was used |

## Response

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

## Errors

- 403 history_not_in_plan — a season before your plan’s history
- 404 no_data — the source ranks no statistics for this team, league and season

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/ranks?league=…&season=…"
```

TypeScript:

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

Python:

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

Go:

```go
res, err := client.Teams.StatisticRanks(ctx, id, &sportsapi.TeamsStatisticRanksParams{League: league, Season: season})
```

CLI:

```bash
$ sportsapi teams statistic-ranks <id> --league <league> --season <season>
```

## Example response

```json
{ "data": { "teamCount": 30, "matches": 15, "ranks": { "points": { "value": 1642, "rank": 21, "rankPerGame": 25 }, "rebounds": { "value": 705, "rank": 9, "rankPerGame": 3 }, … } },
  "meta": { "league": 132, "season": 100772, "type": "regularSeason" } }
```

---

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/statistic-ranks · All docs: https://sportsapi.app/markdown/en/docs.md
