Overview
PM25.in offers a specialized API providing real-time and historical air quality data across various cities in India. Established in 2017, the platform focuses on delivering environmental data essential for applications requiring granular insights into pollution levels. Developers and technical buyers can integrate this data to build tools for environmental monitoring, public health alerts, academic research, or smart city initiatives.
The API provides access to key pollutants such as PM2.5, PM10, NO2, SO2, O3, and CO, alongside an overall Air Quality Index (AQI) for specific locations. Data is sourced from government monitoring stations across India and processed to be accessible via a RESTful API. This focus on a specific geographic region differentiates PM25.in from broader global air quality APIs by offering localized, high-resolution data relevant to the Indian context.
Use cases for the PM25.in API extend to mobile applications that display local air quality, web dashboards for real-time pollution tracking, and backend systems for environmental impact assessments. For instance, an application could fetch current PM2.5 levels for Mumbai and alert users if they exceed a predefined threshold. Similarly, historical data can be retrieved to analyze long-term trends in air quality or to correlate pollution events with other environmental factors.
The platform is designed to be accessible, offering a free tier for initial development and basic usage, scaling up to paid plans based on request volume. While competitor services like OpenWeatherMap provide broader weather and air quality data, PM25.in maintains a specific focus on Indian air quality, potentially offering more detailed and localized data for this region. Developers integrate the API directly via HTTP requests, as official client libraries are not provided, allowing for flexibility in programming language choice.
Key features
- Real-time Air Quality Data API: Provides current readings for PM2.5, PM10, NO2, SO2, O3, CO, and AQI for specific locations in India. Data is updated frequently to reflect current conditions.
- Historical Air Quality Data API: Allows retrieval of past air quality measurements, enabling trend analysis, research, and retrospective reporting on pollution levels over time.
- Location-Specific Data: Focuses exclusively on Indian cities, offering detailed air quality information for a wide range of urban and semi-urban areas.
- Multiple Pollutant Tracking: Supports monitoring of various key atmospheric pollutants, providing a comprehensive view of air quality beyond just particulate matter.
- JSON Data Format: Data is delivered in a standard JSON format, facilitating easy parsing and integration into web and mobile applications using common programming languages.
Pricing
PM25.in offers a free tier and tiered paid plans that scale with request volume. The pricing structure is designed to accommodate various usage levels, from basic development to high-volume commercial applications. As of May 2026, the details are as follows:
| Plan | Requests per Day | Price (INR/month) | Notes |
|---|---|---|---|
| Free Tier | 5,000 | Free | Basic usage, suitable for development and small projects. |
| Starter Paid Tier | 10,000 | 2,000 | Increased request volume for growing applications. |
| Custom Plans | Variable | Contact for Quote | For high-volume enterprise needs. |
For the most current pricing information and detailed plan features, refer to the official PM25.in API pricing page.
Common integrations
The PM25.in API is a RESTful service, meaning it can be integrated with any platform or application capable of making HTTP requests. While there are no official client libraries, its straightforward API design allows for flexible integration into various development environments. Common integration scenarios include:
- Web Applications: Displaying real-time air quality maps or data dashboards using JavaScript frameworks like React, Angular, or Vue.js, fetching data directly from the API.
- Mobile Applications: Incorporating local air quality information into iOS or Android apps, perhaps for health and wellness applications or travel planning.
- IoT Devices and Sensors: Connecting environmental sensors or smart home devices to fetch and display localized air quality data.
- Data Analytics Platforms: Feeding historical air quality data into tools like Tableau, Power BI, or custom Python scripts for environmental research, trend analysis, and reporting.
- Alerting Systems: Building notification services that trigger alerts via email, SMS, or push notifications when air quality in a specific Indian city deteriorates beyond predefined thresholds.
Alternatives
For developers seeking air quality data APIs, several alternatives offer varying scopes and features. While PM25.in specializes in India-specific data, these providers offer broader geographic coverage or different data sets:
- OpenWeatherMap Air Pollution API: Provides global air pollution data, including PM2.5, PM10, CO, SO2, NO2, and O3, often integrated alongside their broader weather data services.
- IQAir Air Quality API: Offers real-time and forecast air quality data for over 10,000 locations worldwide, with a focus on comprehensive pollutant coverage and health recommendations.
- BreezoMeter Air Quality API: Provides highly localized, street-level air quality and pollen data globally, often used for health, smart home, and automotive applications.
Getting started
To begin using the PM25.in API, you typically register on their website to obtain an API key. Once you have your key, you can make HTTP GET requests to the API endpoints. Here's a basic Python example demonstrating how to fetch real-time air quality data for a specific city, such as Delhi, using the requests library:
import requests
import json
API_KEY = "YOUR_API_KEY" # Replace with your actual API key
CITY = "Delhi" # Or any other Indian city supported by PM25.in
# Endpoint for real-time air quality data (example structure)
# Refer to PM25.in API documentation for exact endpoint paths and parameters
# This URL is illustrative based on common API patterns.
api_url = f"https://api.pm25.in/data/aqi?city={CITY}&key={API_KEY}"
try:
response = requests.get(api_url)
response.raise_for_status() # Raise an HTTPError for bad responses (4xx or 5xx)
data = response.json()
print(f"Air Quality Data for {CITY}:")
if data and 'results' in data and len(data['results']) > 0:
# Assuming the API returns a list of results, take the first one
aqi_info = data['results'][0]
print(json.dumps(aqi_info, indent=2))
# Example of accessing specific data points
if 'aqi' in aqi_info:
print(f" AQI: {aqi_info['aqi']}")
if 'pm25' in aqi_info:
print(f" PM2.5: {aqi_info['pm25']} µg/m³")
if 'timestamp' in aqi_info:
print(f" Last updated: {aqi_info['timestamp']}")
else:
print("No air quality data found for this city or an error occurred.")
except requests.exceptions.HTTPError as http_err:
print(f"HTTP error occurred: {http_err}")
print(f"Response content: {response.text}")
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}")
except json.JSONDecodeError:
print(f"Failed to decode JSON from response: {response.text}")
This Python script demonstrates a common approach to consuming RESTful APIs. It sends a GET request to a hypothetical PM25.in API endpoint for Delhi, expecting a JSON response containing air quality metrics. Remember to replace "YOUR_API_KEY" with your actual key obtained from the PM25.in developer portal and consult their API reference for exact endpoint structures and required parameters to ensure successful data retrieval. The API reference will detail available cities, specific pollutant parameters, and how to request historical data ranges.