skillfed

pyairnow

A lightweight Python wrapper for EPA AirNow Air Quality API

pyairnow v1.4.1 75.0K downloads/30d#14,759 on PyPI13
Permissive license MIT Active released

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 pyairnow

uv

uv add pyairnow

poetry

poetry add pyairnow

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Scientific/Engineering :: Atmospheric ScienceTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

Tags

air quality index api clientairnow python wrapperaqi data asyncepa air quality observationsair pollution forecast apiasync http air qualityzip code air quality lookup
air-qualityasync-httpepa-api

More Libraries packages