act.discovery.get_airnow_obs#

act.discovery.get_airnow_obs(token, date=None, zipcode=None, latlon=None, state=None, distance=25)[source]#

This tool will get current or historical observed AQI values and categories. Current observations can be requested by Zip code or Lat/Lon coordinate. Historical daily observations are requested by state. https://docs.airnowapi.org/

Parameters:
  • token (str) – The access token for accessing the AirNowAPI web server

  • date (str) – The date of the data to be acquired. Format is YYYY-MM-DD. Default is None, which will pull the most recent observations.

  • zipcode (str) – The zipcode of the location for a current data request. If zipcode is not defined then a latlon coordinate must be defined.

  • latlon (array) – The latlon coordinate of the location for a current data request. If latlon is not defined then a zipcode must be defined.

  • state (str) – Two-letter state code used for historical daily observations. Required when date is provided.

  • distance (int) – For current observations, search for data within this distance (in miles). Default is 25 miles.

Returns:

ds (xarray.Dataset) – Returns an xarray dataset object

Example

act.discovery.get_airnow_obs(token=’XXXXXX’, zipcode=’60440’) act.discovery.get_airnow_obs(token=’XXXXXX’, latlon=[45, -87]) act.discovery.get_airnow_obs(token=’XXXXXX’, date=’2025-05-01’, state=’IL’)