Real-time Air Quality Data Β· REST API

Air Quality Data
for Developers

Live AQI, PM2.5, historical trends and health data for cities worldwide. Simple REST API. JSON responses. Up and running in minutes.

100+ Cities covered
6 Pollutants tracked
30d Historical data
99% Uptime target
Simple, transparent plans
Free
Β£ 0
forever
Perfect for side projects, prototyping, and personal use.
100 requests / day
  • βœ“ Live AQI by city name
  • βœ“ Current weather data
  • βœ“ US + China AQI standards
  • βœ“ JSON responses
  • – Historical data
  • – Bulk city queries
  • – CSV exports
  • – Priority support
Get Free Key β†’
Business
Β£ 99
per month
For commercial products, research teams, and high-traffic applications.
50,000 requests / day
  • βœ“ Everything in Pro
  • βœ“ CSV bulk data exports
  • βœ“ Custom city coverage
  • βœ“ Monthly trend reports
  • βœ“ Dedicated support
  • βœ“ SLA agreement
  • βœ“ Invoice billing
  • βœ“ Usage dashboard
Get Business Key β†’
Up and running in seconds
Live AQI by city GET

Fetch current air quality for any city. Pass your API key as a query parameter.

# Request curl https://api.aqi.jeff-o-blogs.com/api/aqi/city \ ?city=Bangkok \ &country=Thailand \ &key=your_api_key
// Response { "success": true, "data": { "name": "Bangkok", "aqi": { "us": 87, "cn": 74 }, "mainPollutant": "p2", "weather": { "temperature": 34, "humidity": 62 } } }
Nearby stations by GPS GET

Find all monitoring stations within a radius of any coordinate. Great for mobile apps.

# Request curl https://api.aqi.jeff-o-blogs.com/api/aqi/nearby \ ?lat=13.756 \ &lon=100.501 \ &radius=50 \ &key=your_api_key
// Response { "success": true, "data": { "count": 3, "stations": [ { "name": "Bangkok", "distance": 2.4, "aqi": { "us": 87 } } ] } }
Historical averages Β· Pro GET

Retrieve hourly or daily AQI averages for trend analysis. Available on Pro and above.

# Request β€” last 7 days, daily averages curl https://api.aqi.jeff-o-blogs.com/api/history/averages \ ?lat=18.788&lon=98.985 \ &period=day&days=7 \ &key=your_pro_key
// Response { "success": true, "data": { "averages": [ { "date": "2026-03-21", "avgAQI": 112, "minAQI": 88, "maxAQI": 145 } ] } }
JavaScript fetch example JS

Drop this into any frontend project. No SDK required β€” it's a plain REST API.

// Fetch Bangkok AQI const res = await fetch( `https://api.aqi.jeff-o-blogs.com/api/aqi/city ?city=Bangkok&country=Thailand &key=${YOUR_KEY}` ); const { data } = await res.json(); console.log( `AQI: ${data.aqi.us}` );
Available endpoints
Endpoint Description Tier
GET /api/aqi/city Live AQI for a named city. Params: city, country, state (optional) Free
GET /api/aqi/nearby Stations near GPS coordinates. Params: lat, lon, radius Free
GET /api/aqi/countries List of all supported countries Free
GET /api/aqi/cities Cities within a state/country. Params: state, country Free
GET /api/history/averages Hourly or daily AQI averages. Params: lat, lon, period, days Pro
GET /api/history/stats Min, max, average AQI over a time period Pro
GET /api/history/location Raw readings for a location with full pollutant breakdown Business
Common questions
Where does the data come from?
Data is sourced from IQAir's global network of professional monitoring stations, supplemented by PurpleAir community sensors for higher density coverage in some areas.
How often is data updated?
Live AQI readings are updated hourly from IQAir's network. Historical averages are computed from readings stored in our MongoDB database each time a user loads a city page.
Is Thailand coverage better than other regions?
Yes β€” we have dedicated coverage for all 77 Thai provinces including remote areas like Mae Hong Son. We use coordinate-based nearest-station fallback when named stations aren't available.
Can I use this for a commercial product?
Pro and Business tiers allow commercial use with no attribution required. Free tier requires a small "Data: Jeffo Blogs AQI" attribution in your UI.
What happens if I exceed my daily limit?
Requests beyond your daily limit return a 429 response with a clear error message. We'll email you before you hit the limit consistently so you can upgrade.
Can I get a custom plan or higher limits?
Yes β€” select Business tier in the form and describe your needs in the use case field. We can accommodate higher limits, custom city coverage, or research/academic pricing.