> For the complete documentation index, see [llms.txt](https://docs.sportmonks.com/v2/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sportmonks.com/v2/endpoint-overview/teams/get-all-leagues-by-team-id.md).

# Get All Leagues by Team ID

### `GET` All Leagues by Team ID

```
https://soccer.sportmonks.com/api/v2.0/teams/{ID}/history
```

| Endpoint details        |         |
| ----------------------- | ------- |
| Authorization           | API Key |
| Pagination              | NO      |
| Allowed nested includes | 0       |

#### Parameters

No parameters available for this endpoint.

#### Include options

No includes available for this endpoint.

#### Example response

{% tabs %}
{% tab title="Request" %}

```
https://soccer.sportmonks.com/api/v2.0/teams/939/history?api_token={API_TOKEN}
```

{% endtab %}

{% tab title="Response" %}

```javascript
"data": [
        {
            "id": 719,
            "name": "2016/2017",
            "league_id": 5,
            "is_current_season": false,
            "current_round_id": null,
            "current_stage_id": null,
            "league": {
                "data": {
                    "id": 5,
                    "active": true,
                    "type": "cup_international",
                    "legacy_id": 12,
                    "country_id": 41,
                    "logo_path": "https://cdn.sportmonks.com/images/soccer/leagues/5.png",
                    "name": "Europa League",
                    "is_cup": true,
                    "is_friendly": false,
                    "current_season_id": 18629,
                    "current_round_id": null,
                    "current_stage_id": 77454501,
                    "live_standings": true,
                    "coverage": {
                        "predictions": false,
                        "topscorer_goals": true,
                        "topscorer_assists": true,
                        "topscorer_cards": true
                    }
                }
            }
        },
        {
            "id": 746,
            "name": "2016/2017",
            "league_id": 277,
            "is_current_season": false,
            "current_round_id": null,
            "current_stage_id": null,
            "league": {
                "data": {
                    "id": 277,
                    "active": true,
                    "type": "domestic_cup",
                    "legacy_id": 103,
                    "country_id": 320,
                    "logo_path": "https://cdn.sportmonks.com/images//soccer/leagues/21/277.png",
                    "name": "Landspokal Cup",
                    "is_cup": true,
                    "is_friendly": false,
                    "current_season_id": 18558,
                    "current_round_id": null,
                    "current_stage_id": 77454306,
                    "live_standings": false,
                    "coverage": {
                        "predictions": false,
                        "topscorer_goals": true,
                        "topscorer_assists": true,
                        "topscorer_cards": true
                    }
                }
            }
        },
        {
            "id": 759,
            "name": "2016/2017",
            "league_id": 271,
            "is_current_season": false,
            "current_round_id": null,
            "current_stage_id": null,
            "league": {
                "data": {
                    "id": 271,
                    "active": true,
                    "type": "domestic",
                    "legacy_id": 43,
                    "country_id": 320,
                    "logo_path": "https://cdn.sportmonks.com/images/soccer/leagues/271.png",
                    "name": "Superliga",
                    "is_cup": false,
                    "is_friendly": false,
                    "current_season_id": 18334,
                    "current_round_id": 246626,
                    "current_stage_id": 77453568,
                    "live_standings": true,
                    "coverage": {
                        "predictions": true,
                        "topscorer_goals": true,
                        "topscorer_assists": true,
                        "topscorer_cards": true
                    }
                }
            }
        },
```

{% endtab %}

{% tab title="Field Description" %}

| Field                | Description                                                                                                                                                                  |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `data`               | Opens an array of data you've requested                                                                                                                                      |
| `id`                 | A unique league id                                                                                                                                                           |
| `active`             | Indicates if the league is active or not. Possible values are 'true' or 'false'                                                                                              |
| `type`               | Indicates what kind of league this is. Possible values: 'domestic', 'cup', 'international'. More values can be found [here](/v2/api-references/statussus-and-definitions.md) |
| `legacy_id`          | This was for our API version 1.0. It's only of use for old users of our API                                                                                                  |
| `country_id`         | The unique country id the league is played in                                                                                                                                |
| `logo_path`          | The logo URL path of the league                                                                                                                                              |
| `name`               | The name of the league                                                                                                                                                       |
| `is_cup`             | Indicates if the league is a cup or not. Possible values are 'true' or 'false'                                                                                               |
| `current_season_id`  | The unique id of the current season                                                                                                                                          |
| `current_round_id`   | The unique id of the current round                                                                                                                                           |
| `current_stage_id`   | The unique id of the current stage                                                                                                                                           |
| `live_standings`     | Indicates if the league covers live standings                                                                                                                                |
| `coverage`           | Opens an array of partial coverage for the league                                                                                                                            |
| `predictions`        | Indicates if the league covers predictions                                                                                                                                   |
| `topscorers_goals`   | Indicates if the league covers goal topscorers                                                                                                                               |
| `topscorers_assists` | Indicates if the league covers assists topscorers                                                                                                                            |
| `topscorers_cards`   | Indicates if the league covers cards topscorers                                                                                                                              |
| {% endtab %}         |                                                                                                                                                                              |
| {% endtabs %}        |                                                                                                                                                                              |

{% hint style="info" %}
Check this endpoint in Postman.\
&#x20;                                                             [![Run in Postman](https://run.pstmn.io/button.svg)](https://football-postman.sportmonks.com/#4aad7415-b852-40db-b781-6522e277bf2b)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sportmonks.com/v2/endpoint-overview/teams/get-all-leagues-by-team-id.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
