Skip to content
datasportsAPI

TeamsTeam leagues

Documentation

/

Type to filter the docs by title or path.

TeamsEndpoint 44 of 116

Team leagues

GET

/v2/teams/{id}/leagues

Plan
All plans
Auth
Bearer dsa_live_…
Parameters
1 required · 0 optional
Returns
LeagueRef[]

All competitions the team takes part in now or has taken part in before: domestic league, cups, European competitions and friendly tournaments.

Worth knowing

Use a returned league id with /v2/leagues/{id}/seasons and the other season endpoints. Players do not need this step, as /v2/players/{id}/seasons already returns their leagues together with the seasons. The array is empty when the source lists no competitions.

01Parameters

  • idpathRequired

    DataSportsAPI team id, a positive integer

02Request

The same call from the command line and each SDK. The SDK lines assume a client created with your key; left out, it is read from DATASPORTSAPI_API_KEY. Installing a client: SDKs & CLI.

curl -H "Authorization: Bearer dsa_live_…" \
    "https://api.datasportsapi.com/v2/teams/{id}/leagues"

03Response

The top-level keys of the JSON body. Each object links to its full shape in the data reference.

data
LeagueRef[]
meta
count
ObjectsLeagueRef
Example response
{ "data": [ { "id": 195828, "name": "Premier League", "slug": "premier-league", "sport": "football", "category": "England",
                "country": { "code": "EN", "name": "England" }, "image": "https://cdn.datasportsapi.com/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 } }

04Errors

Nothing specific to this endpoint: only the account-wide errors below apply.

Any key can also meet401unauthorized429rate_limited429quota_exceeded500internal_errorEvery error code