Get Air Quality Index
epa_airnow_get_conditionsAirNow: Get current AQI observations or the issued AQI forecast for a US location from the AirNow API. Provide either zip_code or both latitude and longitude. Current mode returns the latest hourly NowCast AQI for each pollutant (PM2.5, ozone, PM10) from the closest monitor within 50 miles, with the monitor site name, site ID, and reporting agency; pollutants in one reporting area can come from different monitors. Forecast mode returns every day the reporting area's agency has issued (typically one to five), each with the AQI category, an action-day flag, and the issue date, plus the agency's forecast discussion when one exists; some agencies forecast a category without an AQI number. In forecast mode, set forecast_date to keep only the forecast valid on that date; current mode rejects it. Data are preliminary — suitable for awareness, not regulatory, trend, or enforcement decisions. Responses are cached for ~1 hour.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Data mode: "current" for the latest hourly observations, "forecast" for every forecast day the reporting area has issued | current |
| latitude | No | Latitude in decimal degrees (use with longitude instead of zip_code) | |
| zip_code | No | 5-digit US ZIP code for the location | |
| longitude | No | Longitude in decimal degrees (use with latitude instead of zip_code) | |
| forecast_date | No | Forecast mode only (rejected in current mode): keep just the forecast valid on this date (YYYY-MM-DD). Omit to get every issued forecast day. When no issued day matches, the result is empty and its message lists the issued dates. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Data mode used: "current" or "forecast" | |
| error | No | Present when the call failed. Absent on success. | |
| message | No | Why the result is empty: AirNow's own explanation, the issued forecast dates when forecast_date matched none, or a coverage hint. Absent when data is returned. | |
| attribution | No | Credit to the reporting or forecasting agencies and the U.S. EPA AirNow program, with the preliminary-data notice. Reproduce it when passing this data on. | |
| observations | No | AQI observation or forecast records grouped by reporting area |