Skip to content

Instantly share code, notes, and snippets.

@nfarah86
Created May 18, 2020 06:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nfarah86/d2e3cc9236547e2fa630fd368dfee994 to your computer and use it in GitHub Desktop.
Save nfarah86/d2e3cc9236547e2fa630fd368dfee994 to your computer and use it in GitHub Desktop.
Get weather data
def get_weather_data():
""" get weather data from climacell """
url = "https://api.climacell.co/v3/weather/realtime"
querystring ={"lat":"39.9042","lon":"116.4074","unit_system":"us","fields":"precipitation,wind_gust,humidity,wind_direction,precipitation_type,visibility,cloud_cover,cloud_base,cloud_ceiling,weather_code,feels_like,temp","apikey":CLIMACELL_API_KEY}
weather_response = requests.request("GET", url, params=querystring)
return weather_response.json()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment