Created
May 18, 2020 06:45
-
-
Save nfarah86/c598dbea0274d43215f15c9f01eca672 to your computer and use it in GitHub Desktop.
Get the air quality
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_air_pollution_data(): | |
""" get air quality data from climacell """ | |
url = "https://api.climacell.co/v3/weather/realtime" | |
querystring = {"lat":"39.9042","lon":"116.4074","unit_system":"us","fields":"o3,so2,co,no2,pm10,pm25","apikey":CLIMACELL_API_KEY} | |
air_pollution_response = requests.request("GET", url, params=querystring) | |
return air_pollution_response.json() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment