Authentication
Every request carries your API key in a header.
Request headers
| Header | Value |
|---|---|
x-rapidapi-key |
Your Highlightly or RapidAPI key. Always required. |
x-rapidapi-host |
|
Calling directly against basketball.highlightly.net or
sports.highlightly.net needs the key alone.
These headers apply to API data only. They are not needed when fetching other resources such as team logos or highlight preview images, which are plain public URLs.
With an All Sports API subscription
Basketball data is also available through an All Sports API subscription. The same two headers apply, with the same names and the same rules. The base URL and the host header change, and on RapidAPI the key changes too.
| Basketball API | All Sports API | |
|---|---|---|
| Base URL on Highlightly | https://basketball.highlightly.net |
https://sports.highlightly.net/basketball |
| Base URL on RapidAPI | https://basketball-highlights-api.p.rapidapi.com |
https://sport-highlights-api.p.rapidapi.com/basketball |
x-rapidapi-key on Highlightly |
Your Highlightly API key | Your Highlightly API key |
x-rapidapi-key on RapidAPI |
Your Basketball API key | Your All Sports API key |
x-rapidapi-host |
basketball-highlights-api.p.rapidapi.com |
sport-highlights-api.p.rapidapi.com |
Every base URL, on both platforms, is listed under Base URLs. For requests made across several sports, see All Sports authentication.
Request
curl --request GET \
--url 'https://basketball.highlightly.net/matches?leagueName=NBL&leagueId=1635' \
--header 'x-rapidapi-key: YOUR_API_KEY'
const params = new URLSearchParams({
leagueName: 'NBL',
leagueId: '1635'
})
const response = await fetch(`https://basketball.highlightly.net/matches?${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://basketball.highlightly.net/matches',
params={
'leagueName': 'NBL',
'leagueId': '1635',
},
headers={
'x-rapidapi-key': os.environ['HIGHLIGHTLY_API_KEY'],
},
timeout=10,
)
response.raise_for_status()
data = response.json()
Keep the key private
Keys are managed from your account on Highlightly or on RapidAPI, depending on which one issued it. Accounts are not synced between the two.
Response headers
Every response carries rate limit information alongside the data.
| Header | Meaning |
|---|---|
x-ratelimit-requests-limit |
How many requests your current plan allows. A static value. |
x-ratelimit-requests-remaining |
Requests left before you hit that limit. At zero, further requests fail until your daily quota resets. |
content-type |
Always application/json. XML is not supported. |
Read x-ratelimit-requests-remaining rather than counting requests yourself,
and back off before it reaches zero. See
Pagination and limits
for how your subscription affects the data retrieved.