AQICN API

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

Overview

AQICN (Air Quality Index CN) provides real-time air quality data for over 1,000 cities worldwide, including PM2.5, PM10, ozone, and other pollutant readings. You pass a city name or geographic coordinates along with your API token to get the current AQI and individual pollutant levels. It is great for environmental apps, health dashboards, or travel tools that show air quality conditions.

💡

Beginner Tip

The API returns an AQI number following the US EPA standard scale, where 0-50 is good and anything above 150 is unhealthy; display this alongside the dominant pollutant field to give users meaningful context. You can also use the geo: prefix with latitude and longitude (e.g., geo:48.85;2.35) to look up the nearest station by coordinates.

Available Data

AQICN data via REST API
JSON-formatted response data
Requires API key authentication

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from AQICN",
    "description": "Air Quality Index Data for over 1000 cities",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

data.aqi The overall Air Quality Index value on the US EPA scale (0-500+).
data.city.name Name of the city or monitoring station providing the AQI reading.
data.dominentpol The dominant pollutant driving the current AQI value, e.g., pm25 or o3.
data.iaqi.pm25.v Individual PM2.5 particle concentration value used to compute the AQI.
data.time.s Timestamp of the most recent air quality reading in local time.
data.forecast.daily Daily AQI forecasts for the next few days keyed by pollutant type.

Implementation Example

// ⚠️ Note: This URL may be a documentation page. Check official docs for actual API endpoint.
const url = "https://aqicn.org/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

{"status":"error","data":"Invalid key"} The API token is missing or incorrect.
Register at https://aqicn.org/data-platform/token/ for a free token and pass it as the token query parameter.
{"status":"error","data":"Unknown station"} The city name is not recognized or no monitoring station exists nearby.
Try a major city name or switch to geo:lat;lon format to find the nearest available monitoring station.
Stale or missing pollutant values Some monitoring stations do not report all pollutants, so certain fields may be absent.
Check each pollutant field for null before using it and handle missing data gracefully in your UI.

Matrix Score Breakdown

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

Partially tested on Apr 5, 2026

Technical Specifications

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

Alternatives to AQICN

Technical alternatives for different use cases.

Includes air quality data with no API key required

Better For

Quick prototyping of air quality features

Trade-off

Real-time AQI station-level reporting

Includes air pollution API alongside weather data

Better For

Apps that need both weather and air quality in one API

Trade-off

Dedicated air quality monitoring with detailed pollutant data

Similar APIs

View All →