Skip to content

Instantly share code, notes, and snippets.

@nfarah86
Created May 18, 2020 06:45
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save nfarah86/c598dbea0274d43215f15c9f01eca672 to your computer and use it in GitHub Desktop.
Get the air quality
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