The Weather API: By Zip Code

I found an amazing API on the RapidAPI platform that houses data for weather details and conditions by ZIP code. By changing the inputs, I can display ZIP code specific data and change the city information displayed immediately, including up-to-date temperatures and weather description.

import requests

url = "https://us-weather-by-zip-code.p.rapidapi.com/getweatherzipcode"

querystring = {"zip":"92127"}

headers = {
	"X-RapidAPI-Key": "24a738dc44msh1340883298de7f6p133977jsnb8399f963780",
	"X-RapidAPI-Host": "us-weather-by-zip-code.p.rapidapi.com"
}

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

print(response.text)
{"City":"San Diego","State":"CA","TempF":"69.0","TempC":"20.6","Weather":"Overcast","WindMPH":"4.6","WindDir":"West","RelativeHumidity":"68","VisibilityMiles":"10.00","AirQualityIndex":"84","AirQualityCode":"2","AirQuality":"Moderate","Sunrise":"06:49","Sunset":"18:20","DaylightHours":"11","DaylightMinutes":"31","Code":"Success","Credits":"499601737"}

import requests

url = "https://us-weather-by-zip-code.p.rapidapi.com/getweatherzipcode"

querystring = {"zip":"94114"}

headers = {
	"X-RapidAPI-Key": "24a738dc44msh1340883298de7f6p133977jsnb8399f963780",
	"X-RapidAPI-Host": "us-weather-by-zip-code.p.rapidapi.com"
}

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

print(response.text)
{"City":"San Francisco","State":"CA","TempF":"57.0","TempC":"13.9","Weather":"Overcast","WindMPH":"0.0","WindDir":"North","RelativeHumidity":"87","VisibilityMiles":"10.00","AirQualityIndex":"84","AirQualityCode":"2","AirQuality":"Moderate","Sunrise":"07:14","Sunset":"18:38","DaylightHours":"11","DaylightMinutes":"24","Code":"Success","Credits":"499601736"}