Discovery
League directory
GET/v2/leaguesAll plans
The league directory: every league of one category, or of one sport in one country.
Parameters
category
a category id from /v2/categories (alone — not with country)
sport
a sport slug — with country
country
a two-letter Country.code (EN, ES, US, …; any case) — with sport
Response
- data
LeagueRef[]- meta
- with category: category, count; with sport + country: sport, country, categoryIds (the categories of that country), count, complete (false when some category’s list could not be fetched right now — retry shortly)
- errors
- 400 bad_request — neither category nor sport + country, category together with country, a country that is not two letters, unknown sport404 not_supported — a race-sport category or sport (motorsport, cycling): they have series, not leagues; the message names /v2/series?category=503 upstream_unavailable — none of the country’s category lists could be fetched
Every /v2 call can also answer the common errors.
ExampleTry it →
$ curl -H "Authorization: Bearer sk_live_…" "https://api.sportsapi.app/v2/leagues?sport=football&country=EN" { "data": [ { "id": 195828, "name": "Premier League", "slug": "premier-league", "sport": "football", "category": "England", "country": { "code": "EN", "name": "England" }, "image": "…" }, { "id": 195836, "name": "Championship", … }, { "id": 195840, "name": "FA Cup", … }, … ], "meta": { "sport": "football", "country": "EN", "categoryIds": [456], "count": 41, "complete": true } }