import requests

url = "https://yahoo-weather5.p.rapidapi.com/weather"

querystring = {"location":"San Diego","format":"json","u":"f"}

headers = {
	"X-RapidAPI-Key": "4abcb54450msh7468dfd72294e89p18fbaajsn6d4200063b39",
	"X-RapidAPI-Host": "yahoo-weather5.p.rapidapi.com"
}

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

#print(response.text)

print("San Diego Weather Forecast:" + "\n")
forecast = response.json().get("forecasts")
i = 0
while i < len(forecast):
	for key, value in forecast[i].items():
		print("\t" + key, value)
	i += 1
	print("\n")
San Diego Weather Forecast:

	day Fri
	date 1666926000
	low 53
	high 73
	text Mostly Sunny
	code 34


	day Sat
	date 1667012400
	low 54
	high 74
	text Partly Cloudy
	code 30


	day Sun
	date 1667098800
	low 55
	high 77
	text Partly Cloudy
	code 30


	day Mon
	date 1667185200
	low 58
	high 78
	text Partly Cloudy
	code 30


	day Tue
	date 1667271600
	low 58
	high 70
	text Partly Cloudy
	code 30


	day Wed
	date 1667358000
	low 47
	high 61
	text Mostly Cloudy
	code 28


	day Thu
	date 1667444400
	low 51
	high 74
	text Sunny
	code 32


	day Fri
	date 1667530800
	low 51
	high 72
	text Partly Cloudy
	code 30


	day Sat
	date 1667617200
	low 50
	high 76
	text Mostly Sunny
	code 34


	day Sun
	date 1667703600
	low 51
	high 77
	text Partly Cloudy
	code 30


	day Mon
	date 1667790000
	low 54
	high 78
	text Partly Cloudy
	code 30


	day Tue
	date 1667876400
	low 52
	high 73
	text Mostly Sunny
	code 34