Discover/IQAir API
live

IQAir APIiqair.com

Access real-time AQI rankings, city-level pollutant breakdowns, forecasts, weather, pollen indices, and geographic map clusters via the IQAir API.

Endpoint health
verified 4d ago
get_map_data
get_live_city_ranking
get_city_air_quality
get_world_air_quality
4/4 passing latest checkself-healing
Endpoints
4
Updated
21d ago

What is the IQAir API?

This API exposes 4 endpoints covering global and city-level air quality data from IQAir, including AQI rankings for up to 122 cities, pollutant concentrations, hourly and daily forecasts, and geographic map clusters. The get_city_air_quality endpoint returns the most granular data: per-pollutant AQI and concentration values, weather conditions, pollen indices, and health recommendations for a specific city identified by URL slugs.

Try it

No input parameters required.

api.parse.bot/scraper/04ba50aa-6be3-40a9-8d23-947dfaf5a46d/<endpoint>
Ready to send
Fill in the parameters and hit sign in to send to see live response data here.
Call it over HTTPgrab a free API key at signup
curl -X GET 'https://api.parse.bot/scraper/04ba50aa-6be3-40a9-8d23-947dfaf5a46d/get_world_air_quality' \
  -H 'X-API-Key: $PARSE_API_KEY'
Python SDK · recommended

Typed, relational, agent-ready

A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.

  • Fully typed · autocompletes
  • Objects link to objects
  • Typed errors & pagination

Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:

uv add parse-sdk
uv run parse init
uv run parse add --marketplace iqair-com-api

uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.

"""Walkthrough: IQAir SDK — real-time air quality monitoring, bounded and re-runnable."""
from parse_apis.iqair_air_quality_api import IQAir, CityNotFound

client = IQAir()

# Get global air quality overview — top polluted and cleanest cities
overview = client.worldoverviews.get()
for city in overview.top10_polluted_cities[:3]:
    print(f"Polluted: {city.city} ({city.country}) — AQI {city.aqi}, rank #{city.rank}")

# Live city rankings — all tracked cities sorted by AQI
top_city = client.rankedcities.list(limit=1).first()
if top_city:
    print(f"Most polluted right now: {top_city.city}, {top_city.country} — AQI {top_city.aqi}")

# Drill into a specific city's full air quality detail using URL slugs
try:
    detail = client.citydetails.get(country="usa", state="new-york", city="new-york-city")
    print(f"City: {detail.details.name}, {detail.details.country}")
    for pollutant in detail.pollutants:
        print(f"  {pollutant.pollutant_name}: {pollutant.concentration} {pollutant.unit} (AQI {pollutant.aqi})")
except CityNotFound as exc:
    print(f"City not found: {exc.city}")

# Map clusters for geographic visualization
for cluster in client.mapclusters.list(zoom=2, limit=5):
    print(f"Cluster {cluster.geohash}: {cluster.stations_count} stations, AQI {cluster.aqi}")

print("exercised: worldoverviews.get / rankedcities.list / citydetails.get / mapclusters.list")
All endpoints · 4 totalmissing one? ·

Global air quality overview returning the top 15 most polluted and top 15 cleanest major cities worldwide. Each city entry includes current AQI, geographic identifiers, and a URL slug path usable with get_city_air_quality. Data updates hourly.

Input

No input parameters required.

Response
{
  "type": "object",
  "fields": {
    "top10CleanestCities": "array of ranked city objects ordered by AQI ascending",
    "top10PollutedCities": "array of ranked city objects ordered by AQI descending"
  },
  "sample": {
    "data": {
      "top10CleanestCities": [
        {
          "id": "uf7aCpduMf3Lg4de2",
          "aqi": 11,
          "url": "/thailand/chiang-mai/chiang-mai",
          "city": "Chiang Mai",
          "rank": 1,
          "state": "Chiang Mai",
          "country": "Thailand",
          "flagURL": "https://cdn.airvisual.net/flags/thailand.jpg",
          "updatedAt": "2026-06-11T07:00:00.000Z",
          "followersCount": 15215513
        }
      ],
      "top10PollutedCities": [
        {
          "id": "sbxNsWrjrnPT36jH9",
          "aqi": 166,
          "url": "/uganda/central-region/kampala",
          "city": "Kampala",
          "rank": 1,
          "state": "Central Region",
          "country": "Uganda",
          "flagURL": "https://cdn.airvisual.net/flags/uganda.jpg",
          "updatedAt": "2026-06-11T07:00:00.000Z",
          "followersCount": 12318
        }
      ]
    },
    "status": "success"
  }
}

About the IQAir API

Global Rankings and City Listings

Two endpoints provide worldwide air quality overviews. get_world_air_quality returns the top 15 most polluted and top 15 cleanest major cities, each with current AQI and a URL slug usable as input to get_city_air_quality. get_live_city_ranking extends this to up to 122 cities, sorted by AQI descending, and adds fields like followersCount, flagURL, rank, and per-city updatedAt timestamps. Both endpoints update hourly.

City-Level Detail

get_city_air_quality accepts three required URL slug parameters — city, state, and country — which map directly to the url field returned by the ranking endpoints. The response includes a details object with coordinates, current AQI, hourly and daily forecast arrays, and weather conditions. A pollutants array lists each measured pollutant with pollutantName, aqi, concentration, unit, and description. The recommendations object provides health guidance covering outdoor exercise, window ventilation, mask use, and air purifier operation.

Map Visualization Data

get_map_data accepts an optional bbox parameter (comma-separated minLng,minLat,maxLng,maxLat) and a zoom level from 1 to 20. The response is a markers array where each entry is a geographic cluster containing a geohash, stationsCount, coordinates, and aggregated aqi. Higher zoom values produce more granular clusters suitable for building regional air quality heatmaps. Omitting bbox returns a global view.

Reliability & maintenanceVerified

The IQAir API is a managed, monitored endpoint for iqair.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when iqair.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.

This isn't an official iqair.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.

Last verified
4d ago
Latest check
4/4 endpoints passing
Maintenance
Monitored & self-healing
Will this API break when the source site changes?+
It's built not to. Every endpoint is health-checked on a schedule with automated test probes. When the source site changes and a check fails, the API is automatically queued for repair and re-verified — that's the self-healing layer. Each API page shows when its endpoints were last verified. And because marketplace APIs are shared, any fix reaches everyone using it.
Is this an official API from the source site?+
No — Parse APIs are independent, managed REST wrappers over publicly available data. That is the point: where a site has no official API (or only a limited one), Parse gives you a maintained, monitored endpoint for that data and keeps it working as the site changes — so you get a stable contract over a source that never promised one.
Can I fix or extend this API myself if I need a new endpoint or field?+
Yes — and you don't have to wait on us. This API was generated by the Parse agent, which stays attached. Describe the change in plain English ("add an endpoint that returns reviews", "fix the price field") in the revise box on the API page or via the revise_api MCP tool, and the agent rebuilds it against the live site in minutes. Contributing the change back to the public API is free.
What happens if I call an endpoint that has an issue?+
Errors are machine-readable: a bad call returns a clean status with the list of available endpoints and a repair hint, so an agent (or you) can recover or trigger a fix instead of failing silently. Confirmed failures feed the automatic repair queue.
Common use cases
  • Display a ranked table of the world's most polluted cities using AQI values from get_live_city_ranking.
  • Build a city air quality dashboard showing pollutant concentrations (PM2.5, NO2, O3, etc.) via the pollutants array in get_city_air_quality.
  • Render an interactive air quality map using geographic clusters and AQI values from get_map_data with bounding box and zoom inputs.
  • Surface health recommendations (exercise, masks, ventilation) to users based on current AQI from get_city_air_quality.
  • Power hourly and daily AQI forecast charts using the forecast arrays in the details object of get_city_air_quality.
  • Trigger air quality alerts when AQI exceeds a threshold by polling get_live_city_ranking for monitored cities.
  • Combine pollen index data from get_city_air_quality with weather conditions for seasonal health applications.
Pricing & limitsSee full pricing →
TierPriceCredits/monthRate limit
Free$0/mo1005 req/min
Hobby$30/mo1,00020 req/min
Developer$100/mo5,000100 req/min

One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.

Frequently asked questions
Does IQAir have an official developer API?+
Yes. IQAir offers the AirVisual API at https://www.iqair.com/air-pollution-data-api, which provides air quality data for developers. It has its own authentication and plan structure separate from this Parse API.
What does `get_city_air_quality` return beyond a single AQI number?+
It returns a pollutants array with individual AQI, concentration, and unit for each measured pollutant; a details object with coordinates, current conditions, hourly and daily forecast arrays, and weather data; pollen indices; and a recommendations object with guidance on exercise, windows, masks, and air purifiers.
How many cities are covered by `get_live_city_ranking`, and can I filter by region?+
The endpoint returns up to 122 major cities globally, sorted by AQI descending. There is no region or country filter parameter on this endpoint. You can fork the API on Parse and revise it to add filtering by country or continent if needed.
Does the API expose historical air quality data?+
Not currently. The four endpoints cover real-time AQI rankings, current city conditions, and forecasts, but no historical time-series data. You can fork the API on Parse and revise it to add an endpoint for historical AQI records if that data is accessible from the source.
How fresh is the data, and what are the update intervals?+
The ranking endpoints (get_world_air_quality and get_live_city_ranking) update hourly. get_city_air_quality exposes a per-city updatedAt timestamp in the response so you can verify data freshness for a specific location before acting on it.
Page content last updated . Spec covers 4 endpoints from iqair.com.
Related APIs in WeatherSee all →
Sensor.Community API
Monitor real-time and historical air quality data from thousands of sensors across different locations, filtering by area, country, sensor type, or custom criteria. Access current readings and archived datasets to track pollution patterns and analyze air quality trends over time.
accuweather.com API
Get real-time weather conditions, multi-day forecasts, and health alerts for any location worldwide. Search cities and access detailed data including allergen information and air quality to plan your activities with confidence.
weather.com.cn API
Get real-time weather conditions, 7-day to 40-day forecasts, air quality data, and weather alerts for any city in China. Track hourly observations and life indices to plan your activities with complete weather intelligence.
openweathermap.org API
Search for cities and retrieve live weather conditions and forecasts (current, minutely precipitation, hourly and daily) by coordinates or by city name.
wunderground.com API
Access real-time weather conditions, multi-day forecasts, and detailed historical weather data from thousands of personal and airport weather stations worldwide. Search and retrieve current observations, hourly history, and monthly records to power your weather applications and analysis.
weatherspark.com API
Get historical weather data, current METAR reports, and monthly climate summaries for any location by searching WeatherSpark's comprehensive weather database. Access detailed weather insights including temperature trends, precipitation patterns, and atmospheric conditions to power weather-dependent applications and analysis.
worlddata.info API
Explore global statistics and compare countries across population, economy, demographics, quality of life, education, and health metrics. Search worldwide data on everything from life expectancy and languages to religions and regional breakdowns to gain comprehensive insights into how nations rank against each other.
weatherunderground.com API
Get real-time weather data and 10-day forecasts for any location, with access to current conditions like temperature, humidity, and wind speed. Search for locations and receive detailed weather narratives to plan your day or week ahead.