# GET /v2/leagues/{id}/team-of-the-week

Group: Leagues

The team of the week of one round or week: the best-rated players as a line-up — formation, each player with his team, position, the rating that earned the place and the match it is from.

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

Note: Football: 11 players, order 1 = the goalkeeper; the NBA: 5 players, formation "2-3". Ratings are the source’s match ratings (0–10). A team never changes once published.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | our numeric id (positive integer) |
| `season` | query | yes | a season id from /v2/leagues/{id}/seasons |
| `period` | query | no | a period id from /v2/leagues/{id}/team-of-the-week/periods (default: the newest) |

## Response

- `data`: `TeamOfTheWeek`
- `meta`: season, period (the period served), count (players)
- Objects: TeamOfTheWeek (https://sportsapi.app/markdown/en/reference.md#teamoftheweek)

## Errors

- 403 history_not_in_plan — the season ended before your plan’s history
- 404 no_data — the source has no team of the week for this league and season (yet)
- 404 not_found — period is not one of this season’s periods, or season not one of this league’s

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/leagues/{id}/team-of-the-week?season=…"
```

TypeScript:

```ts
const { data, meta } = await client.leagues.teamOfTheWeek(id, { season });
```

Python:

```python
res = client.leagues.team_of_the_week(id, season=season)
```

Go:

```go
res, err := client.Leagues.TeamOfTheWeek(ctx, id, &sportsapi.LeaguesTeamOfTheWeekParams{Season: season})
```

CLI:

```bash
$ sportsapi leagues team-of-the-week <id> --season <season>
```

## Example response

```json
{ "data": { "period": { "id": 812604, "kind": "round", "sequence": 9, "round": 9, "roundName": "9", … },
    "formation": "3-4-3",
    "players": [
      { "order": 1, "player": { "id": 994363, "name": "Bart Verbruggen", "shortName": "B. Verbruggen", … },
        "team": { "id": 30, "name": "Brighton & Hove Albion", … }, "position": "goalkeeper", "rating": 9.6, "fixtureId": 701188 },
      { "order": 2, "player": { "name": "Jan Paul van Hecke", … }, "position": "defender", "rating": 9.8, … }, … ] },
  "meta": { "season": 200386, "period": 812604, "count": 11 } }
```

---

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/leagues/team-of-the-week · All docs: https://sportsapi.app/markdown/en/docs.md
