# GET /v2/teams/{id}/top-players

Group: Teams

A team’s own season leaderboards in one league — its best-rated players, top scorers, assisters, … — paged like the league leaderboards.

Plans: Pro + Business only (other plans get 403 endpoint_not_in_plan).

Note: The same shape and paging as /v2/leagues/{id}/top-players, limited to this team’s players. An empty array when the source has none for the team in that league and season.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | our numeric id (positive integer) |
| `league` | query | yes | a league id the team plays in (/v2/teams/{id}/leagues) |
| `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 |
| `category` | query | no | one leaderboard only (a category of this season, e.g. goals); unknown → 400 listing the season’s categories |
| `limit` | query | no | entries per leaderboard, 1–50 (default 10) |
| `page` | query | no | page of limit entries, 0–49 (default 0 = the leaders) |

## Response

- `data`: `TopPlayersCategory[]`
- `meta`: season, type (the one used), category (null = all), limit, page, count (categories), hasNextPage
- Objects: TopPlayersCategory (https://sportsapi.app/markdown/en/reference.md#topplayerscategory)

## Errors

- 400 bad_request — league or season missing, or the paging / type / category invalid (as /v2/leagues/{id}/top-players)
- 403 history_not_in_plan — the season ended before your plan’s history
- 404 not_found — season is not one of this league’s 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}/top-players?league=…&season=…"
```

TypeScript:

```ts
const { data, meta } = await client.teams.topPlayers(id, { league, season });
for await (const page of client.teams.topPlayersPages(id, { league, season })) { … }
```

Python:

```python
res = client.teams.top_players(id, league=league, season=season)
for page in client.teams.top_players_pages(id, league=league, season=season): ...
```

Go:

```go
res, err := client.Teams.TopPlayers(ctx, id, &sportsapi.TeamsTopPlayersParams{League: league, Season: season})
for page, err := range client.Teams.TopPlayersPages(ctx, id, &sportsapi.TeamsTopPlayersParams{League: league, Season: season}) { … }
```

CLI:

```bash
$ sportsapi teams top-players <id> --league <league> --season <season>
$ sportsapi teams top-players <id> --league <league> --season <season> --all -o csv
```

## Example response

```json
{ "data": [ { "category": "goals", "statistic": "goals", "players": [
      { "player": { "id": 3759, "name": "Bukayo Saka", … }, "team": { "id": 18, "name": "Arsenal", … }, "value": 3, "appearances": 7,
        "playedEnough": true, "statistics": { "goals": 3, "appearances": 7 } }, … ] }, … ],
  "meta": { "season": 200386, "type": "overall", "category": null, "limit": 10, "page": 0, "count": 26, "hasNextPage": true } }
```

---

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