使用 UAPI 的“查询天气”单接口 skill,处理 查询天气、天气预报、城市天气、adcode天气、实时天气、天气查询 等请求。 Use when the user wants get misc weather, misc weather, weather, weather api, city weather...
Coding
QWeather City Weather
Try itQuery QWeather city codes and real-time weather with bundled executable scripts. Use when users need to resolve city names to QWeather location IDs/adcodes,...
What it does
Query QWeather city codes and real-time weather with bundled executable scripts. Use when users need to resolve city names to QWeather location IDs/adcodes,...
The skill document
qweather-city-weather
Use this skill primarily via the bundled script:
scripts/qweather_query.py
This makes the skill portable across machines and independent from a local Next.js service.
Prerequisites
- Python 3.10+ available
- Required QWeather API key:
- set
QWEATHER_API_KEY, or - pass
--api-key
- set
- Required QWeather API host:
- set
QWEATHER_API_HOST, or - pass
--api-host
- set
Default execution flow
- Search city candidates and get location IDs:
python3 scripts/qweather_query.py search-city --query "Hangzhou" --api-host "" --api-key ""
-
Pick best city by
id/name/adm1/adm2. -
Query current weather with location ID:
python3 scripts/qweather_query.py get-weather --location "101210101" --api-host "" --api-key ""
- Or run one-shot city -> weather:
python3 scripts/qweather_query.py city-weather --query "Hangzhou" --api-host "" --api-key ""
Script command reference
search-city- required:
--query - optional:
--number(default10)
- required:
get-weather- required:
--location
- required:
city-weather- required:
--query - optional:
--preferred-namefor exact city-name match
- required:
Global options for all subcommands:
--api-key--api-host--timeout(seconds, default5.0)
Output and error contract
- Success: JSON with
success: true - Failure: JSON with
success: false+error, process exits non-zero - Never guess city when no result; return explicit no-match failure
Direct API reference
For endpoint and payload details of the official QWeather API, read:
references/qweather-http-contract.md
Related skills
Fetch weather forecasts and current conditions, formatted for Discord display. Use when asked about weather, temperature, rain forecasts, or travel planning...
Fetch weather forecasts, current conditions, historical weather, and air quality with the free Open-Meteo API (no API key). Use for any weather, temperature,...
Daily weather briefing for any city — morning conditions, what to wear, umbrella forecast, evening preview, extreme weather alerts. No API key. Works worldwide.
面向个人用户的天气查询助手,提供实时天气、多日预报、空气质量与智能建议. 核心能力: 城市天气查询、未来7天预报、空气质量分析、出行建议、天气预警提醒 适用场景: 出行规划、穿衣建议、户外活动决策、差旅准备 差异化: 免费版聚焦单城市查询与基础建议,适合个人日常使用 适用关键词: 天气查询, 实时天气, 未来预报, 空气质量, 出行建议, 天气预警
中国天气查询(小米天气 App 同款数据源)。支持城市名/城市代码,实时天气、多日预报、空气质量、降水概率、日出日落。数据与小米天气 App 完全一致,比 wttr.in 更适合国内使用。