Overview

The IQAir API, known as the AirVisual API, offers programmatic access to a global dataset of air quality information. This includes real-time and forecast data for key pollutants, such as PM2.5, PM10, ozone, and nitrogen dioxide, alongside meteorological conditions like temperature, humidity, and wind. The API is structured to support a range of applications requiring environmental data, from consumer-facing health and wellness applications to large-scale urban planning and academic research projects.

IQAir, founded in 1963, has developed a network of air quality monitoring stations and data aggregation techniques. The API leverages this infrastructure to provide data for over 10,000 locations globally. Developers can retrieve current air quality index (AQI) values, pollutant concentrations, and a 7-day forecast. This predictive capability allows applications to inform users about future air quality conditions, which can be critical for planning outdoor activities or managing health conditions affected by air pollution.

The API is particularly well-suited for scenarios where granular, location-specific air quality data is required. For instance, smart city initiatives can integrate the API to inform citizens about local air quality, potentially triggering alerts or recommending actions. Health applications can use the data to provide personalized recommendations for users with respiratory issues. Research projects benefit from access to historical data for trend analysis and environmental impact studies. The API's global coverage and the depth of its data points distinguish it for comprehensive environmental monitoring applications. For comparison, other services like OpenWeatherMap's Air Pollution API also provide air quality data, often integrated with broader weather services.

The data is accessible via RESTful endpoints, allowing developers to query by geographical coordinates, city, or IP address. The documentation provides an interactive API reference and code examples in multiple programming languages, aiming to streamline the integration process. This includes support for common languages like Python, JavaScript, and Java. The API's design focuses on providing actionable environmental intelligence, enabling developers to build applications that respond to and inform about air quality conditions effectively.

Key features

  • Real-time Air Quality Data: Access current Air Quality Index (AQI) values, pollutant concentrations (PM2.5, PM10, O3, NO2, SO2, CO), and primary pollutant identification for specific locations.
  • Air Quality Forecasts: Obtain a 7-day forecast for air quality conditions, including predicted AQI and pollutant levels, enabling proactive planning and alerts.
  • Weather Data Integration: Receive current meteorological conditions such as temperature, humidity, wind speed, and pressure alongside air quality data.
  • Global Coverage: Data available for over 10,000 locations worldwide, allowing for broad geographical application support.
  • Location-Based Queries: Retrieve air quality data using geographical coordinates (latitude/longitude), city names, or IP addresses.
  • Historical Data Access: Access historical air quality data, which supports trend analysis, research, and environmental impact assessments.
  • Multiple SDKs: Officially supported SDKs and code examples in Python, JavaScript, Java, PHP, Go, Ruby, and C# facilitate integration.
  • Interactive API Reference: Comprehensive documentation with an interactive API reference to explore endpoints and test requests directly (IQAir API reference).

Pricing

IQAir offers a tiered pricing model for its AirVisual API, including a free developer plan. Paid plans are structured to accommodate varying levels of API call volumes and data access requirements. The following table summarizes the pricing as of 2026-05-28.

Plan Name Monthly Cost API Calls/Day Features
Developer Plan Free 500 Real-time & forecast data, global coverage, basic support
Startup Plan $99 50,000 All Developer features + increased limits, priority support
Business Plan $499 500,000 All Startup features + higher limits, dedicated support
Enterprise Plan Custom Custom All Business features + custom limits, SLA, custom integrations

For detailed pricing information and current terms, refer to the IQAir API pricing page.

Common integrations

The IQAir API is designed for integration into various platforms and applications:

  • Environmental Monitoring Dashboards: Display real-time air quality data on custom dashboards for public information or internal operational awareness.
  • Health and Wellness Apps: Provide users with personalized air quality alerts and recommendations based on their location and health profile.
  • Smart City Platforms: Integrate air quality data into urban management systems to inform policy decisions, traffic management, and public health initiatives.
  • Home Automation Systems: Trigger smart home devices, such as air purifiers, based on local air quality conditions.
  • Research and Academic Tools: Utilize historical and real-time data for environmental studies, climate change research, and public health analysis.
  • Logistics and Outdoor Activity Planning: Inform route planning for delivery services or provide advisories for outdoor sports and events based on air quality forecasts.

Alternatives

Developers seeking air quality data APIs may consider the following alternatives:

  • OpenWeatherMap: Offers an Air Pollution API as part of its broader weather data services.
  • Tomorrow.io: Provides weather and environmental intelligence APIs, including air quality data.
  • Breezometer: Specializes in hyperlocal air quality and pollen data APIs.

Getting started

To begin using the IQAir API, you first need to sign up for an API key on the IQAir website. Once you have your key, you can make requests to the API endpoints. The following Python example demonstrates how to retrieve current air quality data for a specific city.

import requests

API_KEY = 'YOUR_API_KEY' # Replace with your actual API key
CITY = 'Los Angeles'
STATE = 'California'
COUNTRY = 'USA'

# Endpoint for current city data
url = f"http://api.airvisual.com/v2/city?city={CITY}&state={STATE}&country={COUNTRY}&key={API_KEY}"

try:
    response = requests.get(url)
    response.raise_for_status() # Raise an exception for HTTP errors
    data = response.json()

    if data['status'] == 'success':
        current_aqi = data['data']['current']['pollution']['aqius']
        main_pollutant = data['data']['current']['pollution']['mainus']
        temperature = data['data']['current']['weather']['tp']
        humidity = data['data']['current']['weather']['hu']

        print(f"Current Air Quality in {CITY}, {STATE}, {COUNTRY}:")
        print(f"  AQI (US): {current_aqi}")
        print(f"  Main Pollutant: {main_pollutant}")
        print(f"  Temperature: {temperature}°C")
        print(f"  Humidity: {humidity}%")
    else:
        print(f"Error retrieving data: {data['data']['message']}")

except requests.exceptions.HTTPError as http_err:
    print(f"HTTP error occurred: {http_err}")
except requests.exceptions.ConnectionError as conn_err:
    print(f"Connection error occurred: {conn_err}")
except requests.exceptions.Timeout as timeout_err:
    print(f"Timeout error occurred: {timeout_err}")
except requests.exceptions.RequestException as req_err:
    print(f"An unexpected error occurred: {req_err}")

This Python script uses the requests library to make a GET request to the IQAir API for current air quality data. It then parses the JSON response to extract and display key information such as the AQI, main pollutant, temperature, and humidity. Remember to replace 'YOUR_API_KEY' with your actual API key obtained from the IQAir documentation.