SuperAPI AI 工具集

weather

通用与其它

查看项目

更新于 10-16 06:03

技能介绍

Weather Skill 用于获取当前天气状况和天气预报,主要基于 wttr.in(无需 API 密钥)实现,资料中也提及 Open-Meteo。

用途 该技能适合回答与实时天气和短期预报相关的问题,包括:

  • “天气怎么样?”
  • “今天/明天会下雨吗?”
  • “某城市的温度”
  • “一周天气预报”
  • 旅行规划时的天气查询

不适用场景 以下情况不应使用该技能:

  • 历史天气数据 → 使用天气档案/API
  • 气候分析或趋势 → 使用专门的数据源
  • 超本地微气候数据 → 使用本地传感器
  • 恶劣天气警报 → 查看官方 NWS 来源
  • 航空/航海天气 → 使用专业服务(如 METAR 等)

位置要求 在天气查询中始终包含城市、地区或机场代码。

命令示例 当前天气:

  • 一行摘要:curl -s "wttr.in/London?format=3"
  • 详细当前状况:curl -s "wttr.in/London?0"
  • 指定城市:curl -s "wttr.in/New+York?format=3"

预报:

  • 3 天预报:curl -s "wttr.in/London"
  • 一周预报:curl -s "wttr.in/London?format=v2"
  • 指定日期(0=今天,1=明天,2=后天):curl -s "wttr.in/London?1"

格式选项:

  • 单行:curl -s "wttr.in/London?format=%l:+%c+%t+%w"
  • JSON 输出:curl -s "wttr.in/London?format=j1"
  • PNG 图片:curl -s "wttr.in/London.png" -o weather.png

格式代码:

  • %c — 天气状况 emoji
  • %t — 温度
  • %f — 体感温度
  • %w — 风
  • %h — 湿度
  • %p — 降水
  • %l — 位置

快速响应示例:

  • “天气怎么样?”:curl -s "wttr.in/London?format=%l:+%c+%t+(feels+like+%f),+%w+wind,+%h+humidity"
  • “会下雨吗?”:curl -s "wttr.in/London?format=%l:+%c+%p"
  • “周末预报”:curl -s "wttr.in/London?format=v2"

注意事项:

  • 无需 API 密钥(使用 wttr.in)
  • 有速率限制;不要频繁请求
  • 适用于大多数全球城市
  • 支持机场代码:curl wttr.in/ORD
  • 使用 -s(静默)标志以避免进度条

适用场景 适合日常天气查询、短期出行和旅行前的天气检查,支持全球多数城市和机场代码。

限制 存在速率限制,不应频繁请求;不适用于历史数据、气候分析、超本地微气候、恶劣天气警报以及航空/航海等专业天气服务。