IQAir API: Get air quality
Gets a city's current air quality, weather, daily forecast and health advice from IQAir.
Unofficial. Not affiliated with or endorsed by IQAir.
Inputs
Values from the run on Oct 23, 2026, shown under Output.
- City, required
city City to look up, for example Delhi.
Delhi
- Country optional
country Country to distinguish cities with the same name, for example India.
Default
.
Input as JSON
{ "city": "Delhi", "country": ""}Output
{ "city": "Delhi", "aqi_us": 176, "country": "India", "category": "Unhealthy", "iqair_url": "https://www.iqair.com/air-quality/india/delhi/delhi" , "pm25_ug_m3": 90.5, "updated_at": "2026-10-23T14:30:00+05:30", "temperature_c": 32, "daily_forecast": [ { "date": "2026-10-23", "aqi_us": 163, "category": "Unhealthy", "low_temperature_c": 25, "high_temperature_c": 33 }, { "date": "2026-10-24", "aqi_us": 160, "category": "Unhealthy", "low_temperature_c": 26, "high_temperature_c": 34 }, { "date": "2026-10-25", "aqi_us": 157, "category": "Unhealthy", "low_temperature_c": 25, "high_temperature_c": 33 } ], "main_pollutant": "PM2.5", "wind_speed_kmh": 10, "humidity_percent": 21, "health_recommendations": [ "Avoid outdoor exercise", "Close your windows to avoid dirty outdoor air", "Wear a mask outdoors" ], "pm25_who_guideline_times": 18.1}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"iqair.com/get_air_quality","input":{"city":"Delhi","country":""}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "iqair.com/get_air_quality" , "input": { "city": "Delhi", "country": "" }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "iqair.com/get_air_quality" , "input": { "city": "Delhi", "country": "" } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run iqair.com/get_air_quality# with {"city":"Delhi","country":""}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "city" ], "properties": { "city": { "type": "string", "minLength": 1, "description": "City to look up, for example Delhi." }, "country": { "type": "string", "default": "", "description": "Country to distinguish cities with the same name, for example India." } }}Output schema
{ "type": "object", "required": [ "city", "updated_at", "aqi_us", "daily_forecast", "health_recommendations", "iqair_url" ], "properties": { "city": { "type": "string" }, "aqi_us": { "type": "integer" }, "country": { "type": "string" }, "category": { "type": "string" }, "iqair_url": { "type": "string" }, "pm25_ug_m3": { "type": "number" }, "updated_at": { "type": "string" }, "temperature_c": { "type": "number" }, "daily_forecast": { "type": "array", "items": { "type": "object", "properties": { "date": { "type": "string" }, "aqi_us": { "type": "integer" }, "category": { "type": "string" }, "low_temperature_c": { "type": "number" }, "high_temperature_c": { "type": "number" } } } }, "main_pollutant": { "type": "string" }, "wind_speed_kmh": { "type": "number" }, "humidity_percent": { "type": "number" }, "health_recommendations": { "type": "array", "items": { "type": "string" } }, "pm25_who_guideline_times": { "type": "number" } }}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
iqair.com/get_air_quality- Returns
- AQI, category, main pollutant, PM2.5, weather, daily forecast, health advice
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method iqair.com/get_air_quality with the inputs above.
Ask your agent
- What's the air quality like in Delhi right now?
- Current AQI and main pollutant for Lima, Peru
- Is it safe to go jogging outside in Beijing today? Check the pollution level
- Give me the PM2.5 reading and weather forecast for Springfield, United States on iqair.com
- Health advice and 5-day air quality outlook for Hanoi, Vietnam
See more
Gets AirNow current air quality, pollutant readings and today's and tomorrow's forecasts for a US city or ZIP code, or a covered Canadian or Mexican city.
airnow.gov/get_air_qualityGets current conditions and RealFeel for a city or postal code on AccuWeather. The UV level follows standard UV-index ranges. Air quality is null unless it is shown with the current conditions.
accuweather.com/get_current_weatherGets current conditions and today's high and low from The Weather Channel for a city, postcode, ZIP code or street address worldwide. Street addresses are geocoded exactly first; some observations omit gusts or other measurements.
weather.com/get_current_weatherGets current MSN Weather conditions for a city, address or ZIP code. The place is found through OpenStreetMap Nominatim. Matches for broad searches are approximate.
msn.com/get_current_weatherFinds upcoming International Space Station sightings for a city in NASA's city list, with local start times, visibility and sky directions. Cities without scheduled passes return an empty list.
nasa.gov/get_iss_sightingsGets the latest observed weather from a nearby National Weather Service station for a US city, address, or ZIP code. Measurements the station does not report are null.
weather.gov/get_current_conditionsChecks today's delayed and cancelled departures and arrivals at an airport on FlightAware, with current weather and any reported FAA delay status. Delay averages and ground programs are returned only when FlightAware shows them; counts can be null when no statistics row is displayed.
flightaware.com/get_airport_delaysGets the current local time, time zone, and next daylight saving change for a city listed on Time and Date. Add a state or country to distinguish cities with the same name.
timeanddate.com/get_time_in_city