名称: weather
描述: 获取当前天气和天气预报(无需 API 密钥)。
主页: https://wttr.in/:help
元数据: {"clawdbot":{"emoji":"🌤️","requires":{"bins":["curl"]}}}
提供两种免费服务,均无需 API 密钥。
快速单行查询:
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
免费、无需密钥,适合程序化调用:
curl -s "https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.12¤t_weather=true"
使用方法:先查找城市的经纬度坐标,再进行查询。返回包含温度、风速、天气代码的 JSON 数据。
文档地址:https://open-meteo.com/en/docs