天气信息获取Skill weather

此技能用于通过命令行工具快速获取天气信息和预报,使用免费API服务如wttr.in和Open-Meteo,无需API密钥。适用于开发者和数据爱好者,关键词:天气查询、API调用、curl命令、免费服务、天气预报、数据获取。

其他 0 次安装 0 次浏览 更新于 3/24/2026

name: weather description: 获取当前天气和预报(无需API密钥)。 homepage: https://wttr.in/:help metadata: { “otto”: { “emoji”: “🌤️”, “requires”: { “bins”: [“curl”] } } }

天气

两项免费服务,无需API密钥。

wttr.in(主要)

快速单行命令:

curl -s "wttr.in/London?format=3"
# 输出:London: ⛅️ +8°C

紧凑格式:

curl -s "wttr.in/London?format=%l:+%c+%t+%h+%w"
# 输出:London: ⛅️ +8°C 71% ↙5km/h

完整预报:

curl -s "wttr.in/London?T"

格式代码:%c 条件 · %t 温度 · %h 湿度 · %w 风 · %l 位置 · %m 月亮

提示:

  • URL编码空格:wttr.in/New+York
  • 机场代码:wttr.in/JFK
  • 单位:?m(公制) ?u(美制)
  • 仅今天:?1 · 仅当前:?0
  • PNG:curl -s "wttr.in/Berlin.png" -o /tmp/weather.png

Open-Meteo(备用,JSON)

免费,无需密钥,适合程序化使用:

curl -s "https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.12&current_weather=true"

查找城市的坐标,然后查询。返回JSON,包含温度、风速、天气代码。

文档:https://open-meteo.com/en/docs