File contents 天气查询
两个免费服务,无需 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¤t_weather=true"
先查询城市的经纬度坐标,再调用 API。返回包含温度、风速、天气代码的 JSON 数据。
文档:https://open-meteo.com/en/docs
常用查询示例
查询中国城市天气
# 北京天气
curl -s "wttr.in/Beijing?format=3&lang=zh"
# 上海天气
curl -s "wttr.in/Shanghai?lang=zh"
# 广州完整预报
curl -s "wttr.in/Guangzhou?T&lang=zh"
使用说明
快速查询 :使用 format=3 获取最简洁的天气信息
详细预报 :直接访问 wttr.in/城市名 获取 3 天预报
中文显示 :添加 lang=zh 参数可获取中文天气描述
温度单位 :默认使用摄氏度,添加 ?u 切换到华氏度
注意事项
wttr.in 支持中文字符,但建议使用英文城市名或拼音
服务免费但可能有访问频率限制
如需更稳定的服务,可使用 Open-Meteo API
1 --- 2 name: weather-zh 3 description: 获取当前天气和天气预报(无需 API 密钥)。 4 --- 5 6 # 天气查询 7 8 两个免费服务,无需 API 密钥。 9 10 ## wttr.in(主要服务) 11 12 快速单行命令: 13 14 ```bash 15 curl -s "wttr.in/London?format=3" 16 # 输出: London: ⛅️ +8°C 17 ``` 18 19 紧凑格式: 20 21 ```bash 22 curl -s "wttr.in/London?format=%l:+%c+%t+%h+%w" 23 # 输出: London: ⛅️ +8°C 71% ↙5km/h 24 ``` 25 26 完整天气预报: 27 28 ```bash 29 curl -s "wttr.in/London?T" 30 ``` 31 32 格式代码说明: 33 - `%c` 天气状况图标 34 - `%t` 温度 35 - `%h` 湿度 36 - `%w` 风速风向 37 - `%l` 地点名称 38 - `%m` 月相 39 40 使用技巧: 41 42 - URL 编码空格:`wttr.in/New+York` 43 - 使用机场代码:`wttr.in/JFK` 44 - 单位选择:`?m`(公制)`?u`(美制) 45 - 仅今天:`?1` · 仅当前:`?0` 46 - 生成 PNG 图片:`curl -s "wttr.in/Berlin.png" -o /tmp/weather.png` 47 48 ## Open-Meteo(备用服务,JSON 格式) 49 50 免费、无需密钥,适合程序化调用: 51 52 ```bash 53 curl -s "https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.12¤t_weather=true" 54 ``` 55 56 先查询城市的经纬度坐标,再调用 API。返回包含温度、风速、天气代码的 JSON 数据。 57 58 文档:https://open-meteo.com/en/docs 59 60 ## 常用查询示例 61 62 ### 查询中国城市天气 63 64 ```bash 65 # 北京天气 66 curl -s "wttr.in/Beijing?format=3&lang=zh" 67 68 # 上海天气 69 curl -s "wttr.in/Shanghai?lang=zh" 70 71 # 广州完整预报 72 curl -s "wttr.in/Guangzhou?T&lang=zh" 73 ``` 74 75 ### 使用说明 76 77 1. **快速查询**:使用 `format=3` 获取最简洁的天气信息 78 2. **详细预报**:直接访问 `wttr.in/城市名` 获取 3 天预报 79 3. **中文显示**:添加 `lang=zh` 参数可获取中文天气描述 80 4. **温度单位**:默认使用摄氏度,添加 `?u` 切换到华氏度 81 82 ### 注意事项 83 84 - wttr.in 支持中文字符,但建议使用英文城市名或拼音 85 - 服务免费但可能有访问频率限制 86 - 如需更稳定的服务,可使用 Open-Meteo API
l-lesteryu/openclaw-hot-skills-zh/tree/main/skills/weather-zh commit 1c507127c8
Frequently asked questions How do I install the Weather Zh skill? Run npx skillmds@latest add l-lesteryu/weather-zh in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
What does the Weather Zh skill do? 获取当前天气和天气预报(无需 API 密钥)。 It is listed under Integrations & APIs on SkillMD.
Is Weather Zh safe to use? This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
Which AI agents work with Weather Zh? This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Is Weather Zh free to use? Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Who published Weather Zh? l-lesteryu (@l-lesteryu) published this skill. Their other Agent Skills are listed on their SkillMD profile.