PM25.in API

Environment / API Key Intermediate HTTP
Varies by plan (check documentation)

Overview

PM25.in is a Chinese air quality API providing real-time PM2.5, AQI, and related pollution data for cities across China. An API key is required and can be requested through the PM25.in website. The API is particularly useful for applications targeting Chinese users or research on air quality trends in China.

💡

Beginner Tip

The API documentation and service are primarily in Chinese, so a translation tool may be helpful when navigating the docs. Data is returned for specific Chinese city codes, so check the pm25.in city list first to find the correct city parameter for your query.

Available Data

Use case: Integrate air quality of china data into web and mobile applications
PM25.in data via REST API
JSON-formatted response data
Requires API key authentication

Example Response

JSON Response
{
  "status": "success",
  "data": {
    "result": "Data from PM25.in",
    "description": "Air quality of China",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

area Name of the Chinese city or monitoring area where the measurement was taken
pm2_5 PM2.5 concentration in micrograms per cubic meter (μg/m³) at the monitoring station
quality Air quality category in Chinese (e.g. 优/良/轻度污染) based on the measured AQI value
aqi Chinese Air Quality Index value; above 100 indicates pollution, above 200 is severe
time_point Timestamp of the measurement in local Chinese time format

Implementation Example

const url = "http://www.pm25.in/api_doc";
// 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

"stat":"error" Invalid API token or the token has not been activated yet
Apply for an API token at pm25.in and wait for approval; ensure you pass it as the token parameter
Empty data array The city name is incorrect or not supported by the API
Use pinyin city names in lowercase (e.g. "beijing", "shanghai"); check the supported city list in the API documentation
HTTP instead of HTTPS connection warning The API endpoint uses HTTP rather than HTTPS
This is a known limitation of the pm25.in API; be aware that data is transmitted unencrypted and avoid using it for sensitive applications

Matrix Score Breakdown

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

Partially tested on Apr 5, 2026

Technical Specifications

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

Similar APIs

View All →