IQAir API

⭐ Beginner's Pick Environment / API Key Intermediate HTTPS
Varies by plan (check documentation)

Overview

IQAir API provides real-time air quality index (AQI) data and weather conditions for cities and stations worldwide, powered by the IQAir sensor network. You need a free API key to access it, which can be obtained from the IQAir developer portal. It is great for building health-aware applications that notify users about air pollution levels in their area.

💡

Beginner Tip

Register for a free API key at iqair.com/dashboard/api to access up to 10,000 calls per month on the free tier. Start with the nearest-city endpoint by passing lat/lon coordinates to get instant AQI data without needing to know station names.

Available Data

temperature
weather conditions
humidity
wind speed
forecast data
Use case: Integrate air quality and weather data data into web and mobile applications

Example Response

JSON Response
{
  "location": "Tokyo",
  "temperature": {
    "current": 22,
    "feels_like": 24,
    "min": 18,
    "max": 26
  },
  "condition": "Partly Cloudy",
  "humidity": 65,
  "wind": {
    "speed": 12,
    "direction": "NE"
  },
  "forecast": [
    {
      "date": "2025-01-16",
      "high": 25,
      "low": 17,
      "condition": "Sunny"
    }
  ]
}

Field Reference

status Response status; "success" indicates a valid result was returned
data.city Name of the city for which air quality data is returned
data.current.pollution.aqius US AQI value (0-500); higher values indicate worse air quality (0-50 is Good, 151+ is Unhealthy)
data.current.pollution.mainus Main pollutant driving the AQI, e.g. "p2" for PM2.5 or "o3" for ozone
data.current.weather.tp Current temperature in Celsius at the measurement location
data.current.weather.hu Relative humidity percentage at the measurement location

Implementation Example

const url = "https://www.iqair.com/air-pollution-data-api";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

403 Forbidden / call_limit_reached You have exceeded the free tier monthly request limit
Check your usage in the IQAir dashboard; consider upgrading your plan or caching responses to reduce API calls
city_not_found The requested city or country name does not match IQAir coverage
Use the /countries, /states, and /cities endpoints first to discover valid location names before querying AQI data
401 Unauthorized API key is missing or invalid in the request
Ensure you append key=YOUR_API_KEY as a query parameter; check the IQAir dashboard to confirm your key is active

Matrix Score Breakdown

🌐 Reachability 0/30
⚡ Speed 10/20
🔒 Security 15/15
🛠 Developer XP 12/20
✓ Reliability 0/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Environment
Difficulty Intermediate
Verified: 2026-04-04

Recipes Using IQAir

Build something with this API. Each recipe includes step-by-step instructions and code outlines.

Similar APIs

View All →