# IQAir API

> IQAir returns city air quality, weather, forecasts, and health advice as a workflow and API.

IQAir, also called AirVisual, returns current city air quality, weather, daily forecasts, and health advice; provide a city and optionally a country. Get air quality returns AQI, PM2.5, weather readings, and forecasts, though some data may be unavailable for certain cities.

- Page: https://fous.com/workflows/iqair
- Handle: `@iqair`
- Category: [Weather](https://fous.com/workflows/category/weather)
- Source website: https://iqair.com
- Last verified: Sep 29, 2026
- Fous is not affiliated with IQAir.

## Methods

### Get air quality

Operation `get_air_quality`, version 1. 1 credit per call.

Get current city air quality, weather, daily forecast, and health advice from IQAir. Forecast and some readings may be unavailable for certain cities.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `city` | string | yes | `"Delhi"` | City to look up, for example Delhi. |
| `country` | string | no | `"France"` | Country to distinguish cities with the same name, for example India. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "city"
  ],
  "properties": {
    "city": {
      "type": "string",
      "description": "City to look up, for example Delhi.",
      "examples": [
        "Delhi",
        "Paris"
      ]
    },
    "country": {
      "type": "string",
      "default": "",
      "description": "Country to distinguish cities with the same name, for example India.",
      "examples": [
        "France",
        "USA"
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "city": "Delhi"
    },
    {
      "city": "Paris",
      "country": "France"
    },
    {
      "city": "Paris",
      "country": "USA"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `city` | string | `"Delhi"` |  |
| `aqi_us` | integer | `156` |  |
| `country` | string or null | `"India"` |  |
| `category` | string or null | `"Unhealthy"` |  |
| `iqair_url` | string | `"https://www.iqair.com/air-quality/india/delhi/delhi"` |  |
| `pm25_ug_m3` | number or null | `63` |  |
| `updated_at` | string | `"2026-09-29T08:30:00+05:30"` | Observation time in the city, ISO 8601 with offset. |
| `temperature_c` | number or null | `26` |  |
| `daily_forecast` | array |  |  |
| `daily_forecast[].date` | string | `"2026-09-29"` |  |
| `daily_forecast[].aqi_us` | integer or null | `157` |  |
| `daily_forecast[].category` | string or null | `"Unhealthy"` |  |
| `daily_forecast[].low_temperature_c` | number or null | `24` |  |
| `daily_forecast[].high_temperature_c` | number or null | `34` |  |
| `main_pollutant` | string or null | `"PM2.5"` |  |
| `wind_speed_kmh` | number or null | `7` |  |
| `humidity_percent` | number or null | `64` |  |
| `health_recommendations` | array |  |  |
| `pm25_who_guideline_times` | number or null | `12.6` |  |

**Example input**

```json
{
  "city": "Delhi"
}
```

**Example output**

```json
{
  "city": "Delhi",
  "aqi_us": 156,
  "country": "India",
  "category": "Unhealthy",
  "iqair_url": "https://www.iqair.com/air-quality/india/delhi/delhi",
  "pm25_ug_m3": 63,
  "updated_at": "2026-09-29T08:30:00+05:30",
  "temperature_c": 26,
  "daily_forecast": [
    {
      "date": "2026-09-29",
      "aqi_us": 157,
      "category": "Unhealthy",
      "low_temperature_c": 24,
      "high_temperature_c": 34
    },
    {
      "date": "2026-09-30",
      "aqi_us": 154,
      "category": "Unhealthy",
      "low_temperature_c": 28,
      "high_temperature_c": 37
    },
    {
      "date": "2026-10-01",
      "aqi_us": 140,
      "category": "Unhealthy for sensitive groups",
      "low_temperature_c": 29,
      "high_temperature_c": 39
    }
  ],
  "main_pollutant": "PM2.5",
  "wind_speed_kmh": 7,
  "humidity_percent": 64,
  "health_recommendations": [
    "Avoid outdoor exercise",
    "Close your windows to avoid dirty outdoor air",
    "Wear a mask outdoors"
  ],
  "pm25_who_guideline_times": 12.6
}
```

## Quick start

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@iqair",
  "visibility": "public",
  "operation": "get_air_quality",
  "version": 1,
  "input": {
    "city": "Delhi"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

body = json.loads("{\n  \"api\": \"@iqair\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_air_quality\",\n  \"version\": 1,\n  \"input\": {\n    \"city\": \"Delhi\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=120) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_000),
  body: JSON.stringify({
  "api": "@iqair",
  "visibility": "public",
  "operation": "get_air_quality",
  "version": 1,
  "input": {
    "city": "Delhi"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

Or describe the data in plain language: send `{"api":"@iqair","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

## Use cases

- Monitor air quality and PM2.5 levels by city
- Compare pollution levels across cities
- Review daily air quality and temperature forecasts
- Share health recommendations for local conditions

## FAQ

### Is Fous affiliated with IQAir?

No. Fous is not affiliated with IQAir. This workflow reads the public iqair.com website and returns its data.

### How much does it cost?

Each run costs 1 credit. With pay-as-you-go, a credit costs 1¢; monthly plans cost less per credit.

### Do I need a IQAir account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from iqair.com when you run it; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check on Sep 29, 2026.

### What is the current air quality in a city?

Get air quality returns the city’s AQI, category, PM2.5 level, main pollutant, and observation time.

### What is the daily air quality forecast?

Get air quality returns forecast dates, AQI, categories, and low and high temperatures when available.

### What health advice is available for a city?

Get air quality returns health recommendations for the city’s current conditions.

## Related

- [AirNow API](https://fous.com/workflows/airnow.md): Current and forecast air quality for reporting areas in the United States and covered cities in Canada and Mexico.
- [AccuWeather API](https://fous.com/workflows/accuweather.md): AccuWeather provides current conditions and RealFeel, plus up to 15 available daily forecasts; shorter public forecasts may return fewer days.
- [MSN Weather API](https://fous.com/workflows/msn-weather.md): MSN Weather provides current conditions and forecasts for places worldwide, including up to 10 days ahead and optional hourly forecasts for the next 24 hours.
- [The Weather Channel API](https://fous.com/workflows/the-weather-channel.md): The Weather Channel returns current conditions, today’s high/low, up to 15 daily forecasts (sometimes fewer), 1–48 local hourly forecasts, and active severe weather alerts.
- [Weather Underground API](https://fous.com/workflows/weather-underground.md): Historical and current weather conditions from stations worldwide.
- [National Weather Service API](https://fous.com/workflows/national-weather-service.md): National Weather Service provides U.S. day-and-night forecasts for seven days, hourly forecasts for up to 156 hours where available, active alerts, and latest nearby station observations.
- [Pollen.com API](https://fous.com/workflows/pollen-com.md): Pollen levels and allergy forecasts for locations in the United States.
- [Time and Date API](https://fous.com/workflows/time-and-date.md): Time and Date provides current city times, zones, daylight-saving changes; meeting conversions (1970–2030); daily solar times and twilight; and business-day counts based on published holiday calendars.
- [All Weather workflows](https://fous.com/workflows/category/weather)
