天气查询
Query weather information for cities worldwide using the free Open-Meteo API. Supports current weather, multi-day forecasts, hourly data, and air quality without requiring an API key.
它能帮你做什么
先看懂,再决定要不要交给 AI。
Weather Query is a skill that fetches weather information using the free Open-Meteo API, which requires no API key or authentication. It supports querying weather for any city worldwide, including current conditions, multi-day forecasts (up to 16 days), hourly forecasts, and air quality data. The skill can report temperature (current, feels-like, min/max), weather conditions (sunny, cloudy, rain, snow), humidity, precipitation, wind speed and direction, AQI, UV index, and sunrise/sunset times. Both Celsius and Fahrenheit are supported. The skill provides a helper Python script (weather.py) for common queries and documents the direct REST API endpoints for geocoding and weather forecasting for custom integrations.
怎么交给 AI
在线读取优先,本地安装作为备选。
适合能访问网页的 ChatGPT、Agent 或其他 AI。
请访问 https://skills.dhmip.cn/skills/colorful-lollipop/weather-query/SKILL.md,读取并按照该 Skill 完成任务;如当前环境支持本地安装,也可以下载该 Skill。未登录时可使用公共安装文档;登录后可以按不同 AI 分开管理。
请根据 https://skills.dhmip.cn/install/skillhub.md,安装 @colorful-lollipop/weather-query。兼容性与要求
安装或使用前,先确认环境是否匹配。
适用客户端
使用要求
- Python 3.x runtime
- Network access to api.open-meteo.com and geocoding-api.open-meteo.com
- Optional: ability to execute Python scripts in the scripts/ directory
⌘技术详情查看完整 SKILL.md 与原始内容⌄
name: weather-query
description: Query weather information for cities worldwide. Use this skill when users ask about weather, temperature, forecasts, or climate conditions for any location. This skill supports current weather, multi-day forecasts, and air quality data. Activate whenever the user mentions weather, forecast, temperature, rain, snow, or asks about conditions in a specific city or location.
Weather Query Skill
A skill for fetching weather information using the free Open-Meteo API (no API key required).
Capabilities
- Get current weather for any city worldwide
- Get multi-day weather forecasts (up to 16 days)
- Get hourly weather data
- Get air quality information
- Support for both Celsius and Fahrenheit
Supported Weather Data
- Temperature (current, feels-like, min/max)
- Weather conditions (sunny, cloudy, rain, snow, etc.)
- Humidity and precipitation
- Wind speed and direction
- Air quality index (AQI)
- UV index
- Sunrise/sunset times
Usage
Basic Usage
When the user asks for weather information:
- Identify the location (city name)
- Determine what data they need:
- Current weather only
- Multi-day forecast
- Specific metrics (temperature, rain, etc.)
- Use the provided scripts or API calls to fetch data
- Present the information in a clear, human-readable format
Available Scripts
The skill includes helper scripts in the scripts/ directory:
weather.py- Main weather query script with full functionality
Using the Script Directly
# Current weather for a city
python scripts/weather.py --city "Beijing"
# 7-day forecast
python scripts/weather.py --city "Shanghai" --days 7
# Weather with air quality
python scripts/weather.py --city "Guangzhou" --aqi
# Hourly forecast for today
python scripts/weather.py --city "Shenzhen" --hourly
Direct API Usage
If you need to make custom API calls:
Geocoding (convert city name to coordinates):
https://geocoding-api.open-meteo.com/v1/search?name={city}&count=1&language=zh&format=json
Weather data:
https://api.open-meteo.com/v1/forecast?latitude={lat}&longitude={lon}¤t=temperature_2m,relative_humidity_2m,apparent_temperature,weather_code,wind_speed_10m&daily=weather_code,temperature_2m_max,temperature_2m_min&timezone=auto
Weather Code Reference
| Code | Description |
|------|-------------|
| 0 | Clear sky |
| 1-3 | Partly cloudy |
| 45, 48 | Foggy |
| 51-55 | Drizzle |
| 61-65 | Rain |
| 71-77 | Snow |
| 80-82 | Rain showers |
| 85-86 | Snow showers |
| 95-99 | Thunderstorm |
Output Format
Always present weather information in a friendly format:
🌤️ 北京当前天气
━━━━━━━━━━━━━━━━━━━
🌡️ 温度: 22°C (体感 24°C)
☁️ 天气: 多云
💧 湿度: 65%
💨 风速: 12 km/h
━━━━━━━━━━━━━━━━━━━
Examples
User: "北京今天天气怎么样?"
→ Fetch current weather for Beijing and display temperature, conditions, and humidity.
User: "纽约未来一周的天气预报"
→ Fetch 7-day forecast for New York City with daily highs/lows and conditions.
User: "Tokyo weather with air quality"
→ Fetch current weather + air quality index for Tokyo.
Notes
- Open-Meteo API is free and requires no authentication
- Data is sourced from national weather services worldwide
- Forecast accuracy varies by region but is generally reliable
- Air quality data may not be available for all locations