My Personal API (Weather)

from curses.ascii import US
from parso import split_lines
import requests

url = "https://weatherbit-v1-mashape.p.rapidapi.com/forecast/3hourly"

querystring = {"lat":"35.5","lon":"-78.5"}

headers = {
	"X-RapidAPI-Key": "26d9a3c8fbmshd1c8fc32ca8acc3p190a69jsn54f737b8e33b",
	"X-RapidAPI-Host": "weatherbit-v1-mashape.p.rapidapi.com"
}

response = requests.request("GET", url, headers=headers, params=querystring)

# print(response.text)

print("Weather")
weathers = response.json().get('data')
for weather in weathers:  # weathers is a list
    if weather["wind_cdir"] == "N":  # this filters for N
        for key, value in weather.items():  # this finds key, value pairs in country
            print(key, value)
Weather
wind_cdir N
rh 51
pod d
pres 1014
clouds 25
vis 36.896
wind_spd 3.88
snow_depth 0
wind_cdir_full north
slp 1022
datetime 2022-10-08:18
ts 1665252000
dewpt 9.5
uv 4.7
wind_dir 4
ghi 739.78
dhi 112.16
ozone 286.8
clouds_hi 100
weather {'description': 'Scattered clouds', 'code': 802, 'icon': 'c02d'}
clouds_low 11
temp 19.9
app_temp 19.3
timestamp_utc 2022-10-08T18:00:00
timestamp_local 2022-10-08T14:00:00
snow 0
wind_gust_spd 4.71
solar_rad 733.805
precip 0
pop 0
dni 882.97
clouds_mid 0
wind_cdir N
rh 90
pod n
pres 1015
clouds 100
vis 3.8
wind_spd 1.88
snow_depth 0
wind_cdir_full north
slp 1022
datetime 2022-10-10:09
ts 1665392400
dewpt 13.2
uv 0
wind_dir 10
ghi 0
dhi 0
ozone 287.3
clouds_hi 13
weather {'description': 'Light shower rain', 'code': 520, 'icon': 'r04n'}
clouds_low 100
temp 14.8
app_temp 14.8
timestamp_utc 2022-10-10T09:00:00
timestamp_local 2022-10-10T05:00:00
snow 0
wind_gust_spd 3.32
solar_rad 0
precip 2.8787613
pop 80
dni 0
clouds_mid 100