AQICN

AQICN

Weather

Air Quality Index Data for over 1000 cities

Visit API

πŸ“š Documentation & Examples

Everything you need to integrate with AQICN

πŸš€ Quick Start Examples

AQICN Javascript Examplejavascript
// AQICN API Example
const response = await fetch('https://aqicn.org/api/', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/json'
    }
});

const data = await response.json();
console.log(data);

Accessing reliable air quality data is crucial for environmental monitoring and public health. The Air Quality Index (AQI) API provides users with real-time air quality information for over 1000 cities worldwide, enabling developers to integrate vital environmental data into their applications. This API is designed to deliver comprehensive air quality metrics, including pollutant concentrations and health advisories, ensuring that users can make informed decisions. By leveraging this API, businesses and developers can enhance their platforms with insightful analytical tools that support sustainable living and environmental awareness.

Utilizing the AQI API comes with numerous advantages. Key benefits include:

  • Comprehensive coverage of air quality data across more than 1000 global cities.
  • Real-time updates ensure accurate and timely information for users.
  • Easy integration capabilities allowing for seamless implementation within various applications.
  • Enhanced user engagement through relevant and impactful environmental data.
  • Support for developers with extensive documentation and resources available at AQICN API Documentation.

Here’s a simple JavaScript code example demonstrating how to call the AQI API:

const apiKey = 'YOUR_API_KEY'; // Replace with your AQICN API key
const city = 'New York'; // Replace with your desired city
const url = `https://api.waqi.info/feed/${city}/?token=${apiKey}`;

fetch(url)
  .then(response => response.json())
  .then(data => {
    if(data.status === 'ok') {
      console.log(`Air Quality Index for ${city}: ${data.data.aqi}`);
    } else {
      console.error('Error fetching data:', data.data);
    }
  })
  .catch(error => console.error('Fetch error:', error));

πŸ“Š 30-Day Uptime History

Daily uptime tracking showing online vs offline minutes

Jun 13Jun 15Jun 17Jun 19Jun 21Jun 23Jun 25Jun 27Jun 29Jul 1Jul 3Jul 5Jul 7Jul 9Jul 1204008001440Minutes
Online
Offline

Related APIs in Weather