Python RapidAPI
import requests
url = "https://radio-world-50-000-radios-stations.p.rapidapi.com/v1/radios/getTopByCountry"
querystring = {"query":"fr"}
headers = {
"X-RapidAPI-Key": "24662782b6msh7d95c7667aea623p12c71ajsnc0aa91d82aa9",
"X-RapidAPI-Host": "radio-world-50-000-radios-stations.p.rapidapi.com"
}
response = requests.request("GET", url, headers=headers, params=querystring)
# printing organized data
stats = response.json().get('radios') # data file type/name
for stat in stats: # list: stat in stats
if stat["channel_id"] == 7751:
for key, value in stat.items():
print(key, value)
import requests
url = "https://radio-world-50-000-radios-stations.p.rapidapi.com/v1/radios/getTopByCountry"
querystring = {"query":"us"}
headers = {
"X-RapidAPI-Key": "f5bcc1b7damsh9cd6eb2e03d6591p14cf1djsn33097094485f",
"X-RapidAPI-Host": "radio-world-50-000-radios-stations.p.rapidapi.com"
}
response = requests.request("GET", url, headers=headers, params=querystring)
# printing organized data
stats = response.json().get('radios') # data file type/name
for stat in stats: # list: stat in stats
if stat["channel_id"] == 58039:
for key, value in stat.items():
print(key, value)