get current air quality by gps coordinates or city using the iqair airvisual api
domain: iqair.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Sign up and generate a free API key at iqair.com/dashboard/api
Call GET https://api.airvisual.com/v2/nearest_city?lat={lat}&lon={lon}&key={API_KEY}
Alternatively use /v2/city?city={city}&state={state}&country={country}&key={API_KEY} for a named lookup
Check the response status field ('success' vs an error code) before reading the payload
Read current.pollution.aqius (US EPA AQI) and current.pollution.aqicn (China MEP AQI), plus current.weather for temperature/humidity/wind
Known gotchas
Stations update only once per hour, so pollution values can be up to ~60 minutes stale
Exceeding roughly 10 calls/second returns too_many_requests, and exceeding your plan's minute/monthly cap returns call_limit_reached — free-tier volume is limited
Pollutant concentration units vary by species (e.g. CO sometimes µg/m3, sometimes ppm) — check the response's units object rather than assuming a fixed unit
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?