KnowAir Weather 明气天气

v1.0.0

Get comprehensive air quality forecast from monitoring stations with up to 15-day coverage via the Caiyun Weather API. Returns AQI, PM2.5, PM10, O3, NO2, SO2...

0· 233· 1 versions· 0 current· 0 all-time· Updated 16h ago· MIT-0
byShuo Wang@shuowang-ai

Install

openclaw skills install knowair-weather

KnowAir Air Quality — Station-Based AQI Forecast

Query comprehensive air quality forecasts from monitoring stations with up to 15-day coverage using the Caiyun Weather API.

Prerequisites

  1. A valid Caiyun Weather API token set as CAIYUN_TOKEN environment variable, or stored in ~/.config/knowair/token.
  2. Coordinates (longitude, latitude) for the target location.

Quick Start

python3 scripts/query_air_quality.py --lng 116.3176 --lat 39.9760

Workflow

  1. Resolve coordinates — convert city name to coordinates if needed.
  2. Run the script:
    python3 scripts/query_air_quality.py --lng <LNG> --lat <LAT>
    
  3. Present results — summarize current AQI level, pollutant trends, best/worst periods, and health advice.

Options

FlagDescriptionDefault
--lngLongitude (-180 to 180)Required
--latLatitude (-90 to 90)Required
--hoursForecast hours (1-360)120
--detail-levelDisplay density 0-6 (0=auto)0
--langOutput language: en or zhen

Defaults

  • Hours: 120 (5 days)
  • Detail level: auto (0)
  • Language: en

Failure Handling

  • Missing token → exit code 2 with setup instructions.
  • API error → exit code 1 with error details.
  • Station data unavailable → falls back to API forecast data.

Version tags

latestvk979dh2ab3nyb1t30dc95d58bd82s7pb

Runtime requirements

💨 Clawdis
Binspython3
EnvCAIYUN_TOKEN
Primary envCAIYUN_TOKEN