Time series · county-aqi-annual
Yearly air quality summary by county
EPA's yearly Air Quality Index (AQI) summary for every US county with a monitor, from 1980: how many days fell in each AQI category, the maximum, 90th-percentile and median daily AQI, and how many days each pollutant set the AQI. Validated EPA AirData; the latest year is partial until EPA's next release completes it.
- Updates
- Every 6 months
- Coverage
- —
- Current version
- —
- Last published
- —
- Validation
- —
- License
- US Government work
- Commercial use
- Allowed
Chart
Use the API
Each series and location is its own small file. The examples follow the series and location picked above. See the docs for versions, caching and errors.
curl
# One series for one place (.json or .csv)
curl -s "https://api.airdata.dev/v1/county-aqi-annual/summary/us-county-09001.json"
# Every series and place in one file
curl -sO "https://api.airdata.dev/v1/county-aqi-annual/download/county-aqi-annual.csv" Python (polars)
import polars as pl
# One series for one place
df = pl.read_csv("https://api.airdata.dev/v1/county-aqi-annual/summary/us-county-09001.csv")
# Every series and place, with series and location columns
everything = pl.read_parquet("https://api.airdata.dev/v1/county-aqi-annual/download/county-aqi-annual.parquet") JavaScript
const res = await fetch("https://api.airdata.dev/v1/county-aqi-annual/summary/us-county-09001.json");
if (!res.ok) throw new Error((await res.json()).detail); // errors are problem+json
const { meta, data } = await res.json();
console.log(meta.location_name, data.at(-1)); // { date, value, ... } Downloads
The whole dataset in one file, with series and location columns. Parquet keeps the column types and is much smaller.
- county-aqi-annual.csv CSV
- county-aqi-annual.parquet Parquet
Schema and series
Each series file has these columns. The bulk downloads add series and location columns in
front.
| Column | Type | Unit | Can be empty | Description |
|---|---|---|---|---|
| date | year (YYYY) | — | no | — |
| days_with_aqi | integer | days | no | Days with an AQI value |
| good_days | integer | days | no | Days rated Good (AQI 0-50) |
| moderate_days | integer | days | no | Days rated Moderate (51-100) |
| unhealthy_sensitive_days | integer | days | no | Days rated Unhealthy for Sensitive Groups (101-150) |
| unhealthy_days | integer | days | no | Days rated Unhealthy (151-200) |
| very_unhealthy_days | integer | days | no | Days rated Very Unhealthy (201-300) |
| hazardous_days | integer | days | no | Days rated Hazardous (301 and above) |
| max_aqi | integer | AQI | no | Highest daily AQI of the year |
| aqi_90th_percentile | integer | AQI | no | 90th percentile of the daily AQI |
| median_aqi | integer | AQI | no | Median daily AQI |
| days_co | integer | days | no | Days carbon monoxide set the AQI |
| days_no2 | integer | days | no | Days nitrogen dioxide set the AQI |
| days_ozone | integer | days | no | Days ozone set the AQI |
| days_pm25 | integer | days | no | Days PM2.5 set the AQI |
| days_pm10 | integer | days | no | Days PM10 set the AQI |
Series
| Series id | Name |
|---|---|
| summary | Yearly AQI summary |
Locations
Covers all 3,222 US counties and equivalents (ids: us-county- plus the 5-digit FIPS code); 15 more named places.
| Location id | Name |
|---|---|
| us-county-09001 | Fairfield County, CT (former county) |
| us-county-09003 | Hartford County, CT (former county) |
| us-county-09005 | Litchfield County, CT (former county) |
| us-county-09007 | Middlesex County, CT (former county) |
| us-county-09009 | New Haven County, CT (former county) |
| us-county-09011 | New London County, CT (former county) |
| us-county-09013 | Tolland County, CT (former county) |
| us-county-09015 | Windham County, CT (former county) |
| us-county-02232 | Skagway-Hoonah-Angoon Census Area, AK (until 2007) |
| us-county-02261 | Valdez-Cordova Census Area, AK (until 2019) |
| us-county-02280 | Wrangell-Petersburg Census Area, AK (until 2008) |
| us-county-66010 | Guam |
| us-county-78010 | St. Croix Island, VI |
| us-county-78020 | St. John Island, VI |
| us-county-78030 | St. Thomas Island, VI |
Place names come from the shared location registry; see Sources.
Source and license
- Source
- EPA AirData annual AQI by county
- Publisher
- US EPA
- License
- US Government work (public domain in the United States) (
LicenseRef-US-Government-Work) - Commercial use
- Allowed
Credit the source with this exact text:
US Environmental Protection Agency. Air Quality System Data Mart [internet database] available via https://www.epa.gov/outdoor-air-quality-data. Accessed on this version's retrieval date.
Checked every 1 day. If the source hasn't changed in 8 months, the status page flags it as stale.
Endpoints
Every URL for this dataset. To pin the current version, put it after the id:
/v1/county-aqi-annual@<version>.
The API reference describes each response.
| What | URL |
|---|---|
| Metadata: version, coverage, downloads, validation | /v1/county-aqi-annual |
| Versions and monthly snapshots | /v1/county-aqi-annual/versions |
| Series and locations | /v1/county-aqi-annual/locations |
| Yearly AQI summary (JSON) | /v1/county-aqi-annual/summary/{location}.json |
| Yearly AQI summary (CSV) | /v1/county-aqi-annual/summary/{location}.csv |
| Whole dataset (CSV) | /v1/county-aqi-annual/download/county-aqi-annual.csv |
| Whole dataset (Parquet) | /v1/county-aqi-annual/download/county-aqi-annual.parquet |