Retrieve outdoor air quality data from the IQAir AirVisual API for a given city or GPS coordinate
domain: api.airvisual.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Get a free API key from the IQAir dashboard at iqair.com/dashboard/api (Community plan); Startup and Enterprise plans unlock additional endpoints and quota.
Call GET https://api.airvisual.com/v2/nearest_city?key={key}&lat={lat}&lon={lon} for the closest station's current AQI, pollutant concentrations and weather.
Call .../v2/countries, .../v2/states, .../v2/cities and .../v2/city (with country/state/city params) to browse specific named locations instead of nearest-match.
Call .../v2/station (Startup plan and above) for a specific ground-level station's sensor data rather than the blended city-level estimate.
Check the response's status field (success, call_limit_reached, api_key_expired, incorrect_api_key, too_many_requests) and respect the documented 10-calls/second ceiling.
Known gotchas
The free Community plan has materially more limited endpoint access and quota than Startup/Enterprise — verify your plan covers the station-level endpoint before depending on it.
Stations update on their own independent cycles (commonly hourly) — polling more frequently does not guarantee fresher data.
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?