Air Quality API - Real-Time AQI & Pollution Monitoring
Monitor and forecast air quality anywhere in the world with APIFreaks’ Air Quality API. This API provides real-time and hourly forecasted AQI data, delivering key pollutants - PM₂.₅, PM₁₀, CO₂, NO₂, SO₂, dust, as well as UV index and regional AQI standards (US & EU) - in a comprehensive response for any city, coordinates, or IP-based location.
By default, the API returns current Air Quality, and when a date range is provided, it switches to forecast mode for up to 6 days, enabling developers to build predictive monitoring and alert systems.
Designed for environmental apps, health advisories, and smart home dashboards, the Air Quality API gives fast, reliable, and actionable air pollution intelligence for developers and data-driven platforms.
Features
Global Air Quality Coverage
Fetch AQI and pollution data for any city, coordinate, or IP address worldwide - real-time or forecasted.
Real-Time & Forecast Data
Instantly get current AQI readings or forecast air pollution data for up to 6 days, with hourly precision.
Comprehensive Pollutant Metrics
Access key air quality parameters including PM₁₀, PM₂.₅, CO₂, NO₂, SO₂, dust levels, and more.
UV & Air Quality Index
Includes both UV Index and Air Quality Index (AQI) standards, supporting US and EU AQI scales.
Detailed Location Context
Each response includes complete geographic context with continent, country, state/province, district, city, locality, postal code, precise coordinates, elevation data, and timezone information.
API Endpoint
How to Guides
Get Real-Time Air Quality by Location, Coordinates, or IP
To fetch the current Air Quality data, simply call the endpoint with a location name, coordinates, or IP address.
Example using Location
Use the location parameter to look up Air Quality weather by any location - city name, address etc.
curl -X 'GET' 'https://api.apifreaks.com/v1.0/weather/air-quality?location=Tokyo,Japan&apiKey=API-KEY'
# Response
{
"location": {
"location_string": "Tokyo,Japan",
"country_name": "Japan",
"state_prov": "",
"city": "Tokyo",
"locality": "",
"latitude": "35.68219",
"longitude": "139.76222",
"elevation": "0",
"timezone": "Asia/Tokyo",
"timezone_abbreviation": "GMT+9"
},
"current": {
"timestamp": "2025-11-11T00:00",
"european_aqi": 67,
"us_aqi": 96,
"pm10": 23.5,
"pm2_5": 22.9,
"carbon_monoxide": 178,
"nitrogen_dioxide": 47.6,
"sulphur_dioxide": 19.7,
"ozone": 19,
"dust": 0,
"uv_index": 0,
"aerosol_optical_depth": 0.09,
"uv_index_clear_sky": 0
}
}
Example using Coordinates
Use the lat and long parameters to retrieve Air Quality conditions for any point on Earth.
curl -X 'GET' 'https://api.apifreaks.com/v1.0/weather/air-quality?lat=34.0522&long=-118.2437&apiKey=API-KEY'
# Response
{
"location": {
"latitude": "34.05220",
"longitude": "-118.24370",
"country_name": "",
"state_prov": "California",
"city": "Los Angeles",
"locality": "",
"elevation": "89",
"timezone": "America/Los_Angeles",
"timezone_abbreviation": "GMT-8"
},
"current": {
"timestamp": "2025-11-10T07:00",
"european_aqi": 58,
"us_aqi": 77,
"pm10": 21,
"pm2_5": 20.9,
"carbon_monoxide": 508,
"nitrogen_dioxide": 45.3,
"sulphur_dioxide": 8.7,
"ozone": 3,
"dust": 0,
"uv_index": 0.2,
"aerosol_optical_depth": 0.07,
"uv_index_clear_sky": 0.2
}
}
Example using IP
Use the ip parameter to display Air Quality information at specific network locations.
curl -X 'GET' https://api.apifreaks.com/v1.0/weather/air-quality?ip=8.8.8.8&apiKey=API-KEY'
# Response
{
"location": {
"continent_code": "NA",
"continent_name": "North America",
"country_code2": "US",
"country_code3": "USA",
"country_name": "United States",
"country_name_official": "United States of America",
"is_eu": false,
"state_prov": "California",
"state_code": "US-CA",
"district": "Santa Clara",
"city": "Mountain View",
"zipcode": "94043-1351",
"latitude": "37.42240",
"longitude": "-122.08421",
"locality": "Charleston Terrace",
"elevation": "3",
"timezone": "America/Los_Angeles",
"timezone_abbreviation": "GMT-8"
},
"current": {
"timestamp": "2025-11-10T07:00",
"european_aqi": 32,
"us_aqi": 58,
"pm10": 18.9,
"pm2_5": 18.5,
"carbon_monoxide": 318,
"nitrogen_dioxide": 43.2,
"sulphur_dioxide": 3.3,
Auto-detect requesting users' IP address
If no location parameters are provided, the API defaults to returning real-time AQI data for the user’s detected IP.
curl -X 'GET' 'https://api.apifreaks.com/v1.0/weather/air-quality?apiKey=API-KEY'
# Response
{
"location": {
"continent_code": "AS",
"continent_name": "Asia",
"country_code2": "PK",
"country_code3": "PAK",
"country_name": "Pakistan",
"country_name_official": "Islamic Republic of Pakistan",
"is_eu": false,
"state_prov": "Punjab",
"state_code": "PK-PB",
"district": "Lahore",
"city": "Lahore",
"zipcode": "54000",
"latitude": "31.52037",
"longitude": "74.35875",
"locality": "Gulberg",
"elevation": "",
"timezone": "Asia/Karachi",
"timezone_abbreviation": "GMT+5"
},
"current": {
"timestamp": "2025-11-10T20:00",
"european_aqi": 99,
"us_aqi": 159,
"pm10": 91.7,
"pm2_5": 90.6,
"carbon_monoxide": 6361,
"nitrogen_dioxide": 101,
"sulphur_dioxide": 20.9,
Get Air Quality Forecast by Date Range
When you include a date range using startDate and endDate , the API switches to forecast mode and provides hourly air pollution forecasts.
To get the air quality forecast, provide the location along with startDate and endDate. The date range must not exceed 6 days.
curl -s -X GET "https://api.apifreaks.com/v1.0/weather/air-quality?location=Paris,%20France&startDate=2025-11-10&endDate=2025-11-11&apiKey=API-KEY"'
# Response
{
"location": {
"location_string": "Paris, France",
"country_name": "France",
"state_prov": "Ile-de-France",
"city": "Paris",
"locality": "",
"latitude": "48.85889",
"longitude": "2.32004",
"elevation": "0",
"timezone": "Europe/Paris",
"timezone_abbreviation": "GMT+1"
},
"forecast": {
"2025-11-10": {
"hourly": [
{
"timestamp": "2025-11-10T00:00",
"pm10": 13.7,
"carbon_monoxide": 213,
"pm2_5": 10.5,
"carbon_dioxide": 474,
"nitrogen_dioxide": 27.6,
"sulphur_dioxide": 1.7,
"ozone": 40,
"dust": 0,
"uv_index": 0,
"aerosol_optical_depth": 0.11,
"uv_index_clear_sky": 0
},
Auto-detect requesting users' IP address
If no location parameters are provided, the API defaults to returning Air Quality Forecast Data for the user’s detected IP.
curl -X 'GET' 'https://api.apifreaks.com/v1.0/weather/air-quality?startDate=2025-11-10&endDate=2025-11-11&apiKey=API-KEY'
# Response
{
"location": {
"continent_code": "AS",
"continent_name": "Asia",
"country_code2": "PK",
"country_code3": "PAK",
"country_name": "Pakistan",
"country_name_official": "Islamic Republic of Pakistan",
"is_eu": false,
"state_prov": "Punjab",
"state_code": "PK-PB",
"district": "Lahore",
"city": "Lahore",
"zipcode": "54000",
"latitude": "31.52037",
"longitude": "74.35875",
"locality": "Gulberg",
"elevation": "",
"timezone": "Asia/Karachi",
"timezone_abbreviation": "GMT+5"
},
"forecast": {
"2025-11-10": {
"hourly": [
{
"timestamp": "2025-11-10T00:00",
"pm10": 90.6,
"carbon_monoxide": 3765,
"pm2_5": 89.6,
"carbon_dioxide": 483,
Pricing
To use the Air Quality, API credits are required. Charges apply only for successful queries, defined by a 2xx status code. If a request results in a 4xx or 5xx status code, no credits will be deducted, and any credits already charged will be refunded.
For each successful request, 2 credit will be charged. Utilize the Credits Usage API to efficiently monitor your recent consumption of both one-off and subscription credits. This API provides a streamlined way to track and manage your credit usage, ensuring you stay informed about your remaining balance and can optimize your resource allocation effectively.