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

Group: Teams

Every competition the team plays in or has played in — domestic league, cups, European competitions, friendly tournaments.

Note: Pass a league id to /v2/leagues/{id}/seasons and the season endpoints. For a player, /v2/players/{id}/seasons already lists his leagues with their seasons. An empty array where the source lists none.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | our numeric id (positive integer) |

## Response

- `data`: `LeagueRef[]`
- `meta`: count
- Objects: LeagueRef (https://sportsapi.app/markdown/en/reference.md#leagueref)

## Request

cURL:

```bash
curl -H "Authorization: Bearer sk_live_…" \
    "https://api.sportsapi.app/v2/teams/{id}/leagues"
```

TypeScript:

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

Python:

```python
res = client.teams.leagues(id)
```

Go:

```go
res, err := client.Teams.Leagues(ctx, id)
```

CLI:

```bash
$ sportsapi teams leagues <id>
```

## Example response

```json
{ "data": [ { "id": 195828, "name": "Premier League", "slug": "premier-league", "sport": "football", "category": "England",
                "country": { "code": "EN", "name": "England" }, "image": "https://cdn.sportsapi.app/v2/leagues/195828/logo" },
    { "id": 195841, "name": "EFL Cup", … }, { "id": 195840, "name": "FA Cup", … },
    { "id": 195900, "name": "UEFA Champions League", "category": "Europe", "country": null, … },
    { "id": 196215, "name": "Emirates Cup", … }, … ],
  "meta": { "count": 9 } }
```

---

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