Get country by code
Retrieve one country by its code.
- Refresh interval
- Once a day
The path parameter follows the
ISO 3166
standard, for example /countries/AU.
Country name and code can then be used to query other resources such as matches, leagues and highlights.
Parameters
| Parameter | Type | Description |
|---|---|---|
countryCoderequired
|
stringpath | A string value code of the country, following the ISO 3166 standard. |
Request
curl --request GET \
--url 'https://basketball.highlightly.net/countries/{countryCode}' \
--header 'x-rapidapi-key: YOUR_API_KEY'
const response = await fetch('https://basketball.highlightly.net/countries/{countryCode}', {
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/countries/{countryCode}',
headers={
'x-rapidapi-key': os.environ['HIGHLIGHTLY_API_KEY'],
},
timeout=10,
)
response.raise_for_status()
data = response.json()
Response
codestringrequiredCountry code specified by the ISO 3166 standard.
namestringrequired
logostringrequired
Example response
[
{
"code": "AU",
"name": "Australia",
"logo": "https://example.com/logos/country/AU.png"
}
]
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. |
Using a country code
Country codes come from countries. These endpoints accept one.
| Endpoint | Parameter |
|---|---|
| Highlights | countryCode |
| Leagues | countryCode |
| Matches | countryCode |