skillfed

pyairvisual

A simple API for AirVisual air quality data

pyairvisual v2023.12.0 74.0K downloads/30d#14,897 on PyPI10
Permissive license MIT Active released

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 pyairvisual

uv

uv add pyairvisual

poetry

poetry add pyairvisual

Installing 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

License :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

air quality data apiairvisual python clientasync air quality lookupaqi retrieval libraryenvironmental monitoring apilocation-based air qualitystation air quality data
air-qualityasync-httpenvironmental-data

More Internet packages