# GET /v2/leagues/{id}/cup-trees

Group: Leagues

The season’s knockout brackets — a cup’s knockout stage, playoffs, a tennis draw: rounds → ties → the two participants (team, seed, winner, score) → our fixture ids.

Note: score is the source’s figure for the tie: aggregate goals over two legs (football), games won in a series (basketball, ice hockey), sets (tennis); penalties = shoot-out goals. fromBlock is the order of the previous round’s tie the participant came from; team null = a placeholder slot (“winner of QF 1”); matchCount 0 = a bye. Fetch the fixtures with /v2/fixtures/{id}. An empty array when the season has no knockout stage.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | our numeric id (positive integer) |
| `season` | query | yes | a season id from /v2/leagues/{id}/seasons |

## Response

- `data`: `CupTree[]`
- `meta`: season, count
- Objects: CupTree (https://sportsapi.app/markdown/en/reference.md#cuptree)

## Errors

- 400 bad_request — missing or invalid season
- 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 (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/leagues/{id}/cup-trees?season=…"
```

TypeScript:

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

Python:

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

Go:

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

CLI:

```bash
$ sportsapi leagues cup-trees <id> --season <season>
```

## Example response

```json
{ "data": [ { "name": "CONMEBOL Libertadores 2026, Knockout stage", "currentRound": 3, "rounds": [ …,
    { "order": 3, "name": "Semifinals", "blocks": [
      { "order": 1, "finished": true, "inProgress": false, "startTime": "2026-10-16T00:30:00.000Z",
        "matchCount": 2, "fixtureIds": [789, 790], "automaticProgression": false, "venue": null,
        "home": { "team": { "id": 11, "name": "Estudiantes de La Plata", "slug": "estudiantes-de-la-plata", "shortName": "Estudiantes", "code": "ELP", "image": "…" },
                  "seed": null, "winner": true, "score": 0, "penalties": 3, "fromBlock": 1 },
        "away": { "team": { "id": 12, "name": "Flamengo", … }, "seed": null, "winner": false, "score": 0, "penalties": 2, "fromBlock": 2 } }, … ] }, … ] } ],
  "meta": { "season": 87760, "count": 1 } }
```

---

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