Team leagues
GET
/
View as MarkdownTry in Playground →
All competitions the team takes part in now or has taken part in before: domestic league, cups, European competitions and friendly tournaments.
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.
Parameters
idpathrequired
DataSportsAPI team id, a positive integer
Response
- data
LeagueRef[]- meta
- count
Any /v2 call can also come back with one of the common errors.
curl -H "Authorization: Bearer sk_live_…" \
"https://api.datasportsapi.com/v2/teams/{id}/leagues"Example
{ "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 } }