Leagues
Retrieve a list of leagues.
- Refresh interval
- Multiple times a day
- Pagination
- limit and offset
Use leagueName to check whether a specific league exists, or to fetch just
its record. Narrow further with countryCode or countryName,
both of which come from countries.
limit sets how many leagues come back. When the number of matching leagues
exceeds it, request the next page by increasing offset. See
Pagination and limits.
Leagues carry their seasons
Each league record includes its associated seasons. That matters because
standings requires both a
leagueId and a season, and the season values come from here.
The usual sequence is to fetch a league once, store its id and the seasons you care about, then query the other endpoints with those values rather than by name. Name filters work, but an id matches exactly where a name depends on spelling.
Parameters
| Parameter | Type | Description |
|---|---|---|
limitoptional |
numberdefault 100
|
No description in the spec.e.g. 100
|
offsetoptional |
numberdefault 0
|
No description in the spec.e.g. 0
|
seasonoptional |
number |
No description in the spec.e.g. 2023
|
leagueNameoptional
|
string |
No description in the spec.e.g. Superettan
|
countryCodeoptional
|
string |
Country code specified by the ISO 3166 standard.e.g. SE
|
countryNameoptional
|
string |
No description in the spec.e.g. Sweden
|
Request
curl --request GET \
--url 'https://soccer.highlightly.net/leagues?season=2023&leagueName=Superettan' \
--header 'x-rapidapi-key: YOUR_API_KEY'
const params = new URLSearchParams({
season: '2023',
leagueName: 'Superettan'
})
const response = await fetch(`https://soccer.highlightly.net/leagues?${params}`, {
headers: {
'x-rapidapi-key': process.env.HIGHLIGHTLY_API_KEY
}
})
if (!response.ok) {
throw new Error(`Highlightly responded ${response.status}`)
}
const data = await response.json()
import os
import requests
response = requests.get(
'https://soccer.highlightly.net/leagues',
params={
'season': '2023',
'leagueName': 'Superettan',
},
headers={
'x-rapidapi-key': os.environ['HIGHLIGHTLY_API_KEY'],
},
timeout=10,
)
response.raise_for_status()
data = response.json()
Response
dataLeagueResponse[]required9 fields
idnumberrequired
logostring
namestringrequired
countryCountryResponserequired3 fields
codestringrequiredCountry code specified by the ISO 3166 standard.
namestringrequired
logostringrequired
seasonsSeasonResponse[]required1 field
seasonnumberrequired
paginationPaginationResponserequired3 fields
totalCountnumberrequiredAvailable number of items, relevant to the provided query.
offsetnumberrequired
limitnumberrequired
planPlanResponserequired2 fields
tierstringrequiredYour current API subscription tier.
messagestringrequiredExplanation message regarding your current tier.
Example response
{
"data": [
{
"id": 104,
"logo": "https://example.com/logos/league/104.png",
"name": "UEFA Champions League",
"country": {
"code": "FR",
"name": "France",
"logo": "https://example.com/logos/country/FR.png"
},
"seasons": [
{
"season": 2022
}
]
}
],
"pagination": {
"totalCount": 490,
"offset": 20,
"limit": 100
},
"plan": {
"tier": "BASIC",
"message": "Some results might be hidden with FREE tier. Check your API coverage for more information: https://rapidapi.com/highlightly-api-highlightly-api-default/api/sport-highlights-api/details"
}
}
Values are the examples declared in the OpenAPI spec, not a captured live response.
Errors
| Status | Description |
|---|---|
400 |
Bad request descriptive error. |
500 |
Internal server error. |