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

The kind of data this API exposes, based on its documentation. We could not call the endpoint to confirm the exact field names.

Use case: Integrate air quality of china data into web and mobile applications
PM25.in data via REST API

Example Response

Illustrative shape only — we were not able to call this endpoint (it requires credentials or exposes no public sample URL), so the fields below show the kind of data this API returns rather than a recorded response.

JSON Response · Illustrative
{
  "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

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "http://www.pm25.in/api/querys/pm2_5.json?token=YOUR_API_KEY&city=beijing";
// 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

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

"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

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth API Key
HTTPS NO
CORS UNKNOWN
Category Environment
Difficulty Intermediate
Listing details not endpoint-verified

Related Tags

Similar APIs

View All →