Overview

The AQICN API, established in 2014, offers developers programmatic access to a global network of air quality monitoring data. It specializes in providing real-time, historical, and forecasted Air Quality Index (AQI) information for numerous locations worldwide. The API aggregates data from various official monitoring stations and provides it in a standardized format, suitable for integration into diverse applications.

This API is primarily designed for projects focusing on environmental monitoring, academic research, and non-commercial applications. It enables developers to build tools that inform users about local air pollution levels, track changes over time, or predict future air quality conditions. The data includes measurements for key pollutants such as PM2.5, PM10, ozone (O3), carbon monoxide (CO), sulfur dioxide (SO2), and nitrogen dioxide (NO2), allowing for detailed analysis of specific environmental factors. For example, a developer could build a mobile application that alerts users when PM2.5 levels exceed a certain threshold in their area, drawing directly from the AQICN API reference.

The service offers a straightforward approach to retrieving air quality data, often requiring only an API key and location coordinates or city name. This accessibility makes it a suitable choice for rapid prototyping and deployment of environmental data-driven projects. While it serves a broad user base, its free tier and pricing structure are particularly beneficial for individuals and small organizations with limited budgets, making environmental data more accessible for public awareness and scientific inquiry. Integration examples are provided across several popular programming languages, simplifying the development process for a wide audience of technical users.

For more advanced use cases, the API also supports historical data retrieval, which can be critical for climate modeling, health studies, and long-term environmental trend analysis. Developers can request data spanning specific periods, enabling them to visualize and analyze air quality patterns over months or years. This capability distinguishes it for researchers needing robust data sets for scientific publications or policy recommendations. Understanding general API design principles, such as those discussed in Mozilla's API glossary, can further aid in efficient integration and utilization of the AQICN API.

Key features

  • Real-time Air Quality Data: Access up-to-the-minute Air Quality Index (AQI) and pollutant concentrations for various locations globally.
  • Historical Air Quality Data: Retrieve past air quality measurements, enabling trend analysis and environmental research over specified periods.
  • Air Quality Forecast: Obtain predictions for future air quality conditions, useful for planning and public health advisories.
  • Pollutant-Specific Data: Detailed readings for PM2.5, PM10, O3, CO, SO2, and NO2, allowing granular environmental analysis.
  • Geographic Querying: Supports querying by city name, latitude/longitude coordinates, and IP address for flexible location targeting.
  • Multi-language Support: Documentation and examples available for JavaScript, Python, PHP, Ruby, Java, Go, and Node.js.
  • API Key Management: Dashboard-based management of API keys, usage tracking, and subscription details.

Pricing

AQICN offers a free tier for non-commercial use and several paid plans for increased API call limits and commercial applications. Pricing details are current as of May 2026.

Plan Name API Calls/Day Monthly Cost Features
Free 500 $0 Real-time data, personal/non-commercial use
Hobbyist 5,000 $20 All Free features + commercial use
Startup 50,000 $100 All Hobbyist features + higher limits
Business 500,000 $500 All Startup features + further increased limits
Enterprise Custom Contact for quote Custom limits and dedicated support

For the most current and detailed pricing information, refer to the official AQICN API pricing page.

Common integrations

  • Weather Applications: Integrate air quality data with weather forecasts for comprehensive environmental reporting.
  • Smart Home Systems: Display local air quality on smart displays or integrate with air purifiers based on real-time data.
  • Environmental Monitoring Dashboards: Create custom dashboards for tracking air pollution trends in specific regions.
  • Health and Wellness Apps: Alert users about poor air quality conditions that may impact outdoor activities or respiratory health.
  • Academic Research Platforms: Incorporate historical air quality data for climate studies, public health research, and geographical analysis.

Alternatives

  • OpenWeatherMap: Offers comprehensive weather data including some air quality metrics, alongside traditional weather forecasts.
  • Tomorrow.io: Provides hyper-local weather and environmental intelligence, including air quality forecasts.
  • BreezoMeter: Specializes in high-resolution, real-time air quality and pollen data, with a focus on health impacts.

Getting started

To begin using the AQICN API, you will need to obtain an API key from the AQICN API homepage. Once you have your key, you can make requests to the API endpoints. Below is a Python example demonstrating how to retrieve real-time air quality data for a specific city. This example uses the requests library to make an HTTP GET request and processes the JSON response.

import requests
import json

API_KEY = 'YOUR_API_KEY' # Replace with your actual API key
CITY_NAME = 'london' # Example city

# Construct the API endpoint URL for real-time data by city
# Documentation for city feed API: https://aqicn.org/api/doc/#api-Feed-GetCityFeed
url = f"http://api.waqi.info/feed/{CITY_NAME}/?token={API_KEY}"

try:
    response = requests.get(url)
    response.raise_for_status() # Raise an HTTPError for bad responses (4xx or 5xx)
    data = response.json()

    if data['status'] == 'ok':
        aqi = data['data']['aqi']
        city_station = data['data']['city']['name']
        print(f"Current AQI in {city_station}: {aqi}")

        # Optionally, print details for specific pollutants
        iaqi_data = data['data'].get('iaqi', {})
        print("Pollutant details:")
        for pollutant, value_obj in iaqi_data.items():
            if 'v' in value_obj:
                print(f"  {pollutant.upper()}: {value_obj['v']}")
    else:
        print(f"Error retrieving data: {data.get('data', 'Unknown error')}")

except requests.exceptions.RequestException as e:
    print(f"Request failed: {e}")
except json.JSONDecodeError:
    print("Failed to decode JSON response.")
except KeyError as e:
    print(f"Missing expected key in API response: {e}")

This Python code snippet connects to the AQICN API to fetch the current Air Quality Index for London. It demonstrates error handling for network issues and API-specific response statuses. After executing, it will output the current AQI and the values for various individual pollutants if available in the response. Further details on API parameters and response formats can be found in the comprehensive AQICN API documentation.