Created
May 18, 2020 06:44
-
-
Save nfarah86/d2e3cc9236547e2fa630fd368dfee994 to your computer and use it in GitHub Desktop.
Get weather data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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