API Usage and Organization: Radio Stations (France)

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)
image_url https://mypromotions.sfo2.cdn.digitaloceanspaces.com/radios/7751.jpg
name France Info
uri https://icecast.radiofrance.fr/franceinfo-midfi.mp3
channel_id 7751
countryCode fr
genre News,Talk

Alternate Query (US)

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)
image_url https://mypromotions.sfo2.cdn.digitaloceanspaces.com/radios/58039.jpg
name FOX News Radio
uri https://streaming-ent.shoutcast.com/foxnews
channel_id 58039
countryCode us
genre News,Talk