AI Navigate

🌫️ Air Quality Index API: Real-Time AQI

Dev.to / 3/15/2026

📰 NewsDeveloper Stack & InfrastructureTools & Practical Usage

Key Points

  • The AQI API provides real-time data on AQI, PM2.5, PM10, CO, and weather context (temperature, humidity, wind speed) to help plan outdoor activities.
  • It includes AI-powered health recommendations tailored to your planned activity, duration, and medical conditions such as asthma.
  • The API targets multiple use cases, including fitness apps, travel platforms, health assistants, smart cities, and wearables, enabling alerts and route planning around pollution hotspots.
  • There are two usage options: a no-code Apify Console workflow and API integration, with examples (including a curl snippet) and no API key required (credentials managed by the actor).

🌫️ Air Quality Index API: Real-Time AQI Data + AI Health Recommendations

Air pollution affects 99% of the global population. Whether you're planning a morning jog, managing asthma, or building a health app — knowing the air quality before you step outside is critical.

That's why I built the Air Quality Index (AQI) API — a real-time API that delivers AQI data, pollution metrics, weather info, and AI-powered health recommendations for outdoor activities.

✨ What You Get

📊 Real-Time AQI & Pollution Metrics

  • AQI (Air Quality Index) - Overall air quality score
  • PM2.5 - Fine particulate matter (most harmful)
  • PM10 - Coarse particulate matter
  • CO - Carbon monoxide levels
  • Temperature, Humidity, Wind Speed - Weather context

🧠 AI-Powered Health Recommendations

Personalized guidance based on:

  • Your planned outdoor activity (running, cycling, walking)
  • Duration of exposure
  • Medical conditions (asthma, allergies, respiratory issues)

No API key required — Mistral credentials are managed by the actor.

🎯 Perfect For

Use Case Application
Fitness Apps Warn users before outdoor workouts
Travel Platforms Route planning around pollution hotspots
Health Assistants Daily air quality briefings for sensitive users
Smart Cities Environmental dashboards & alerts
Wearables Real-time AQI notifications

🚀 How to Use It

Option 1: Apify Console (No-Code)

  1. Visit AQI API on Apify
  2. Enter your city (e.g., "Delhi", "Los Angeles", "Beijing")
  3. Specify planned activity (e.g., "morning jog for 45 minutes")
  4. Add medical conditions if applicable (e.g., "asthma")
  5. Click Start → Get results in seconds

Option 2: API Integration

curl -X POST \
  https://api.apify.com/v2/acts/akash9078~air-quality-index-aqi-api/runs \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_APIFY_TOKEN' \
  -d '{
    "city": "Delhi",
    "state": "Delhi",
    "country": "India",
    "plannedActivity": "morning walk",
    "medicalConditions": "asthma"
  }'

📊 Sample Output

{
  "success": true,
  "location": {
    "city": "Delhi",
    "state": "Delhi",
    "country": "India"
  },
  "aqi_data": {
    "aqi": 135,
    "temperature": 31.4,
    "humidity": 41.0,
    "wind_speed": 16.6,
    "pm25": 51.0,
    "pm10": 65.0,
    "co": 312.0
  },
  "recommendations": "AQI is 135 (Unhealthy for Sensitive Groups). For a 30-minute morning walk with asthma: wear an N95 mask, avoid busy roads, consider indoor exercise if symptoms appear.",
  "charges": [
    { "event": "aqi_data_fetch", "price": 0.005 },
    { "event": "health_recommendation", "price": 0.005 }
  ],
  "total_price": 0.01
}

💰 Transparent Pricing

Pay-per-event pricing:

Event Price
AQI Data Fetch $0.005
Health Recommendation $0.005
Total per run $0.01

That's 1 cent per query — affordable for apps of any scale.

🔧 Technical Details

  • Data Source: aqi.in with resilient scraping logic
  • AI Model: Mistral Large for health recommendations
  • Runtime: Python with fallback extraction methods
  • Output: Structured JSON with full charge transparency

🌍 Real-World Use Cases

The Fitness App Developer

"Integrated the AQI API into our running app. Now users get automatic air quality alerts before their outdoor workouts. Reduced user complaints about breathing issues by 60%."

The Travel Planner

"We use this to warn travelers about pollution in destinations like Delhi, Beijing, and Bangkok. Helps them pack masks and plan indoor alternatives."

The Asthma Management App

"Daily AQI checks with personalized recommendations are now a core feature. Users love the 'should I go outside today?' guidance."

⚠️ Important Notes

  • Not a medical diagnosis — provides informational guidance only
  • Always consult healthcare professionals for medical advice
  • Data sourced from third-party providers; occasional delays possible
  • Zero AQI values may indicate temporary source unavailability

🌱 Why Air Quality Matters

  • 7 million premature deaths annually linked to air pollution (WHO)
  • PM2.5 particles can enter bloodstream and affect organs
  • Real-time awareness helps vulnerable populations stay safe
  • AI recommendations bridge data → actionable health guidance

🔗 Try It Now

Protect your users, yourself, and your community with real-time air quality intelligence.

Try AQI API for Free

Built with ❤️ by @akash9078 on the Apify platform.

What's your city's AQI today? Let me know in the comments! 👇