pyairnow
A lightweight Python wrapper for EPA AirNow Air Quality API
What it is and what it does
pyairnow is a lightweight async Python client for the EPA's AirNow Air Quality Index API. It provides a simple interface to fetch current air quality observations and forecasts for any US location by zip code or latitude/longitude coordinates. The library wraps the AirNow API endpoints and handles the HTTP communication using aiohttp, supporting both the current API format and a legacy format for backward compatibility.
The package is designed for developers who need to integrate air quality data into their applications—whether for environmental monitoring, health alerts, or data analysis. It includes convenience functions to convert between AQI values and pollutant concentrations (ozone, PM2.5, PM10, carbon monoxide, sulfur dioxide, nitrogen dioxide) following EPA guidelines. All API calls are async, and you can optionally pass your own aiohttp ClientSession for connection pooling if making many requests.
Use it for:
- Fetch current air quality observations for a location to display in a weather or health app.
- Retrieve multi-day air quality forecasts by zip code for planning outdoor activities.
- Convert raw pollutant concentration measurements to standardized AQI values for reporting.
- Monitor air quality across multiple locations concurrently using async calls with a shared connection pool.
- Build a backend service that periodically queries AirNow data and stores it in a database.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A thin async Python client for the EPA AirNow Air Quality Index API, supporting current observations and forecasts by zip code or coordinates.
Yes. Active maintenance, low install friction, no known vulnerabilities, permissive license, and modern Python support make this a solid choice for integrating EPA air quality data. The async design and optional connection pooling support both simple and high-volume use cases. Requires only an API key registration.
Install
pyairnow on PyPI
pip
pip install pyairnowuv
uv add pyairnowpoetry
poetry add pyairnowInstalling pyairnow
Before you install
Low friction install with a single async dependency (aiohttp). Active maintenance with recent release (14 days old) and modern Python support (3.10–3.13). Repository is not archived and shows ongoing development.
License in practice
MIT license is permissive; you can use, modify, and distribute this package with minimal restrictions, provided you include the license notice.
Quickstart
pip install pyairnow
import asyncio
from pyairnow import WebServiceAPI
async def main():
client = WebServiceAPI('your-api-key')
data = await client.observations.zipCode('90001')
print(data)
asyncio.run(main())
Requires an AirNow API key (free, obtained from https://docs.airnowapi.org/account/request/). All calls are async and must run in an event loop.
Verify before relying
- Whether the library handles rate limiting or retry logic for AirNow API calls.
- Performance characteristics when making many concurrent requests without connection pooling.
- Exact error handling and exception types raised for invalid API keys or network failures.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — aiohttp |
| Maintenance | actively maintained — 14 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 74,998/month — #14,759 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyairnow-1.4.1-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
pyairvisualA thin async Python wrapper for the AirVisual…
permissive · top 15,000 on PyPI
accuweatherAsync Python wrapper for fetching current…
permissive · top 15,000 on PyPI
pyowmPyOWM is a Python client library that wraps…
permissive · top 15,000 on PyPI
giosFetches real-time air quality measurements from…
permissive · top 15,000 on PyPI
aioairqAsynchronous Python library for retrieving…
permissive · top 15,000 on PyPI
aiorecollectAsyncio-based Python library for querying waste…
permissive · top 15,000 on PyPI
aioridwellAn asyncio-based Python library for querying…
permissive · top 15,000 on PyPI
nettigo-air-monitorFetches and parses air quality data from…
permissive · top 15,000 on PyPI
meteomaticsConnects Python applications to the Meteomatics…
permissive · top 15,000 on PyPI
aioambientAn async Python library for querying Ambient…
permissive · top 15,000 on PyPI