← 返回
开发者工具 Key 中文

IQAir Air Quality

Get real-time air quality data from IQAir API for any location worldwide. Returns AQI (Air Quality Index) with visual indicators and quality levels. Use when...
通过IQAir API获取全球任意地点的实时空气质量数据。返回带有可视化指标和质量等级的AQI(空气质量指数)。
atesluks atesluks 来源
开发者工具 clawhub v1.0.2 1 版本 99906.5 Key: 需要
★ 3
Stars
📥 1,009
下载
💾 9
安装
1
版本
#latest

概述

IQAir Air Quality Checker

Get real-time air quality data from the IQAir API with formatted output including AQI score, emoji indicator, and quality level.

Prerequisites

API Key Required: User must have a free IQAir API key stored in the IQAIR_API_KEY environment variable.

If the key is not set, guide the user:

  1. Visit https://dashboard.iqair.com/personal/api-keys
  2. Sign up/sign in and subscribe to the free Community plan
  3. Copy the API key
  4. Set it: export IQAIR_API_KEY="your_key_here"

Quick Usage

By city name:

python scripts/get_aqi.py Riga Latvia
python scripts/get_aqi.py London "United Kingdom"
python scripts/get_aqi.py Budapest Hungary

By coordinates (most reliable):

python scripts/get_aqi.py --lat 56.9496 --lon 24.1052

Nearest city (based on IP):

python scripts/get_aqi.py --nearest

How to Respond to User Queries

When a user asks about air quality:

  1. Determine the location - Extract city/country from their query
  2. Run the script - Use scripts/get_aqi.py with appropriate arguments
  3. Return formatted output - The script provides emoji, AQI value, level, and location

Example interaction:

User: "How good is air in Riga?"

Response process:

  • Location: Riga, Latvia
  • Run: python scripts/get_aqi.py Riga Latvia
  • Output: 🟢 19 - Good\nRiga, Latvia
  • Reply: "Air quality in Riga is currently excellent! 🟢 19 (Good)"

Handling Location Names

City/country names:

  • Use exact names as they appear in IQAir's database
  • Capital cities: Often the state/province matches the city name
  • If city lookup fails, try coordinates instead

Common location patterns:

  • Riga, Latvia → Riga Latvia (state defaults to city)
  • London, UK → London "United Kingdom" (quote if spaces)
  • New York, USA → "New York" "United States" "New York" (city, country, state)

When in doubt: Use coordinate-based lookup with --lat and --lon (more reliable).

Output Format

The script returns a concise, formatted string:

🟢 45 - Good
Riga, Latvia

Customize your response based on the AQI level:

  • 0-50 (🟢 Good): "Excellent", "Perfect for outdoor activities"
  • 51-100 (🟡 Moderate): "Acceptable", "Sensitive people should limit prolonged outdoor exertion"
  • 101-150 (🟠 USG): "Unhealthy for sensitive groups", "Children and people with respiratory issues should reduce outdoor exertion"
  • 151-200 (🔴 Unhealthy): "Everyone may experience health effects", "Reduce outdoor activities"
  • 201-300 (🟣 Very Unhealthy): "Health alert", "Avoid outdoor activities"
  • 301+ (🟤 Hazardous): "Emergency conditions", "Stay indoors"

Technical Details

For API specifications, endpoints, and error handling, see references/api.md.

Rate Limits

Free Community plan limits:

  • 5 calls/minute
  • 500 calls/day
  • 10,000 calls/month

Avoid making repeated calls for the same location within short time periods.

版本历史

共 1 个版本

  • v1.0.2 当前
    2026-03-29 07:21 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 205 📥 66,743
data-analysis

AdMapix

fly0pants
广告情报与应用数据分析助手,支持搜索广告素材、分析应用排名、下载量、收入及市场洞察,用于广告素材和竞品分析。
★ 295 📥 137,025
data-analysis

Stock Watcher

robin797860
管理和监控个人股票自选列表,支持利用同花顺数据添加、删除、列出股票及汇总近期表现。适用于用户希望追踪特定股票、获取表现汇总或管理自选列表时。
★ 112 📥 45,726