airq 0.7.2

A command-line tool to check air quality (AQI, PM2.5, PM10) from Open-Meteo and Sensor.Community
Documentation

airq

Crates.io License: MIT

Check air quality from your terminal. Any city in the world, no API key needed.

By default merges two data sources for more accurate results:

  • Open-Meteo — global model (PM2.5, PM10, CO, NO2, O3, SO2, UV)
  • Sensor.Community — citizen science sensors (15,000+ real sensors worldwide)

Install

brew install fortunto2/tap/airq     # Homebrew
cargo install airq                  # crates.io

Quick start

airq --city gazipasa
Resolved city: Gazipaşa, Türkiye
Sources: Open-Meteo (model) + Sensor.Community (1 sensors, 5km median)
--------------------------------------------------
PM2.5  9.6 avg  (12.7 model, 6.5 sensors) μg/m³
PM10   14.7 avg  (16.2 model, 13.1 sensors) μg/m³
CO    159.0 μg/m³
NO2   1.9 μg/m³
O3    73.0 μg/m³
SO2   1.1 μg/m³
UV Index: 0 ☀️ (Low)
--------------------------------------------------
🟢 US AQI: 40 | EU AQI: 29 — Good

Commands

Any city in the world

airq --city tokyo
airq --city "new york"
airq --city berlin
airq --city анталья

By coordinates

airq --lat 55.75 --lon 37.62

History (sparkline)

airq history --city istanbul --days 5
Istanbul, Türkiye — last 5 days
2026-03-09: ██░░░ 10.9 µg/m³ (AQI 44 🟢)
2026-03-10: ███░░ 20.7 µg/m³ (AQI 57 🟡)
2026-03-11: ███░░ 21.5 µg/m³ (AQI 68 🟡)
2026-03-12: ███░░ 17.3 µg/m³ (AQI 68 🟡)
2026-03-13: ███░░ 20.3 µg/m³ (AQI 64 🟡)

Top cities by AQI

airq top --country turkey
airq top --country russia --count 10
airq top --country usa --json
# City              AQI  PM2.5
1 Bursa             143  🟠 52.5
2 Izmir             121  🟠 43.6
3 Ankara            99   🟡 34.8
4 Istanbul          98   🟡 34.6
5 Antalya           72   🟡 22.0

Countries: turkey, russia, usa, germany, japan.

Compare providers

airq compare --city berlin                       # area median (all sensors in 5km)
airq compare --city gazipasa --sensor-id 77955   # specific sensor
Berlin, Germany — Provider Comparison
Sensor.Community: 143 sensors, 5km radius
┌──────────┬───────────┬─────────────────┬─────────┐
│ Metric   │ Open-Meteo│     Area Median │ Average │
├──────────┼───────────┼─────────────────┼─────────┤
│ PM2.5    │       4.2 │             6.8 │     5.5 │
│ PM10     │       5.3 │            11.1 │     8.2 │
│ US AQI   │        31 │       28 (calc) │      29 │
└──────────┴───────────┴─────────────────┴─────────┘

Single provider

airq --city berlin --provider open-meteo          # model only
airq --city berlin --provider sensor-community --sensor-id 72203  # sensor only

JSON output

All commands support --json:

airq --city berlin --json
airq history --city tokyo --days 7 --json
airq top --country usa --json
airq compare --city berlin --json

Find nearby sensors

airq nearby --city gazipasa --radius 10

How it works

By default (--provider all), airq fetches both sources in parallel and averages PM2.5/PM10. Each value shows the breakdown:

PM2.5  4.9 avg  (4.2 model, 5.7 sensors) μg/m³
  • model = Open-Meteo atmospheric reanalysis (global, ~11km grid)
  • sensors = median of all Sensor.Community sensors within 5km (filters outliers)

If no sensors nearby, falls back to model only with a note.

AQI scale

AQI Category Color
0–50 Good 🟢
51–100 Moderate 🟡
101–150 Unhealthy for Sensitive Groups 🟠
151–200 Unhealthy 🔴
201–300 Very Unhealthy 🟣
301–500 Hazardous 🟤

US AQI from Open-Meteo API. EU AQI also shown. For sensor-only data, AQI calculated using EPA formula.

Data sources

Built with

Created by rust-code AI agent in autonomous BigHead mode.

License

MIT