pyairvisual
A simple API for AirVisual air quality data
What it is and what it does
pyairvisual is an async Python client for the AirVisual air quality API. It wraps the AirVisual service to let you query air quality data by city, station, or geographic coordinates, and retrieve supported locations and global rankings depending on your API plan tier (Community, Startup, or Enterprise). The library uses aiohttp for HTTP requests and supports connection pooling via a ClientSession for efficiency.
It also supports direct queries to AirVisual Node/Pro air quality monitoring units, either through the cloud API or over the local network via Samba. The library is async-first, requiring asyncio patterns for all operations, and targets Python 3.10 and later.
Use it for:
- Fetch current air quality metrics for a specific city or geographic location in an async application.
- Query the nearest air quality station or city based on latitude/longitude coordinates.
- Retrieve air quality history and trends from a local Node/Pro monitoring unit over Samba.
- Build a dashboard or alert system that polls multiple cities or stations concurrently using connection pooling.
- List supported countries, states, and cities to populate location selectors in a web or mobile app.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A thin async Python wrapper for the AirVisual API to retrieve air quality data by location, station, or global ranking.
Yes. The package is actively maintained, has low install friction, carries a permissive MIT license, and provides a clean async interface to AirVisual data. Install it if you need to integrate air quality lookups into a Python application and already have or can obtain an AirVisual API key. No known vulnerabilities as of August 2026.
Install
pyairvisual on PyPI
pip
pip install pyairvisualuv
uv add pyairvisualpoetry
poetry add pyairvisualInstalling pyairvisual
Before you install
Low install friction with a pure-Python wheel. Actively maintained as of August 2026 with recent commits; supported on Python 3.10, 3.11, and 3.12.
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install pyairvisual
import asyncio
from pyairvisual.cloud_api import CloudAPI
async def main():
cloud_api = CloudAPI("<YOUR_AIRVISUAL_API_KEY>")
data = await cloud_api.air_quality.nearest_city()
print(data)
asyncio.run(main())
Requires a valid AirVisual API key (available from the AirVisual API site); async/await syntax requires Python 3.10+.
Verify before relying
- Whether the library supports all current AirVisual API endpoints or only a subset of the documented API.
- Performance characteristics when pooling connections across many concurrent requests.
- Whether Node/Pro unit Samba access works reliably across different network configurations.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10,<4.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — aiohttp, certifi, frozenlist, numpy, pygments, pysmb, yarl |
| Maintenance | actively maintained — 970 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 73,962/month — #14,897 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyairvisual-2023.12.0-py3-none-any.whl
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
aioairqAsynchronous Python library for retrieving…
permissive · top 15,000 on PyPI
giosFetches real-time air quality measurements from…
permissive · top 15,000 on PyPI
pyairnowA thin async Python client for the EPA AirNow…
permissive · top 15,000 on PyPI
simplisafe-pythonAn async Python interface to the SimpliSafe API…
permissive · top 15,000 on PyPI
PyRMVtransportQueries real-time and scheduled transport…
permissive · top 15,000 on PyPI
imgw-pibAn async Python wrapper for the IMGW-PIB API…
permissive · top 15,000 on PyPI
aioambientAn async Python library for querying Ambient…
permissive · top 15,000 on PyPI
nettigo-air-monitorFetches and parses air quality data from…
permissive · top 15,000 on PyPI
aiorecollectAsyncio-based Python library for querying waste…
permissive · top 15,000 on PyPI
pytrafikverketAsync Python client for querying Sweden's…
permissive · top 15,000 on PyPI