返回顶部
g

google-weather谷歌天气

Google Weather API - accurate, real-time weather data. Get current conditions, temperature, humidity, wind, and forecasts. Powered by Google's Weather API for reliable, hyperlocal data updated every 15 minutes. Supports any location worldwide.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.3.0
安全检测
已通过
5,542
下载量
免费
免费
5
收藏
概述
安装方式
版本历史

google-weather

Google Weather - 实时天气数据

使用 Google 天气 API 获取准确的天气状况。需要启用天气 API 的 Google Cloud API 密钥。

快速使用

bash

当前天气(格式化输出)


python3 skills/google-weather/lib/weather_helper.py current New York
python3 skills/google-weather/lib/weather_helper.py current London
python3 skills/google-weather/lib/weather_helper.py current Sydney

24小时预报

python3 skills/google-weather/lib/weather_helper.py forecast Tel Aviv

原始 JSON 数据

python3 skills/google-weather/lib/weather_helper.py json Paris

示例输出

公制(默认):

New York
局部多云 ⛅
🌡️ 12°C(体感温度 10°C)
💨 风力:18 km/h 西北风
💧 湿度:55%

英制(GOOGLEWEATHERUNITS=IMPERIAL):

New York
局部多云 ⛅
🌡️ 53.6°F(体感温度 50°F)
💨 风力:11 mph 西北风
💧 湿度:55%

预报:

Tel Aviv 24小时预报
18:00:17.8°C,☀️ 5 km/h 北风
22:00:14.3°C,☀️ 6 km/h 东北偏东风
02:00:12.8°C,⛅ 8 km/h 东北风
06:00:10.8°C,☀️ 6 km/h 东北偏东风
10:00:16.1°C,☀️ 5 km/h 南风
14:00:20.4°C,🌤️ 8 km/h 西北偏西风

支持的地点

全球任何地点 - 只需输入城市名称:

  • - New York、London、Paris、Berlin、Sydney
  • San Francisco、Berlin、Singapore、Dubai
  • 或任何地址、地标、坐标

该技能会自动使用 Google Maps API 对地点进行地理编码。

可用数据

  • - 温度:当前温度 + 体感温度
  • 天气状况:晴、多云、雨、雪等,带表情符号图标
  • 预报:每小时温度、风力、天气状况数据
  • 湿度:百分比
  • 风力:速度、方向、阵风
  • 紫外线指数:日照强度等级
  • 降水量:概率和类型
  • 云量:百分比
  • 能见度:距离

设置

  1. 1. 在 Google Cloud Console 中创建项目
  2. 启用 天气 API
  3. 启用 地理编码 API(用于地点名称查询)
  4. 创建 API 密钥并将其设置为 GOOGLEAPI_KEY 环境变量

如果已配置,也支持 GOOGLEWEATHERAPIKEY 或 GOOGLEMAPSAPIKEY。

配置

单位制

默认情况下,该技能使用公制单位(°C、km/h)。要切换到英制(°F、mph),请设置 GOOGLEWEATHERUNITS 环境变量:

yaml

在您的 OpenClaw 配置中(env 部分):


GOOGLEWEATHERUNITS: IMPERIAL

设置温度风速降水量能见度
METRIC(默认)°Ckm/hmmkm
IMPERIAL
°F | mph | inches | miles |

无需修改代码 — 只需设置环境变量并重启即可。

多语言支持

输出会根据地点自适应 - 支持英语、希伯来语及其他语言,取决于 language 参数。

bash

希伯来语输出


python3 skills/google-weather/lib/weather_helper.py current Tel Aviv

输出:בהיר ☀️ 19°C...

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 google-weather-1776363998 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 google-weather-1776363998 技能

通过命令行安装

skillhub install google-weather-1776363998

下载

⬇ 下载 google-weather v1.3.0(免费)

文件大小: 5.79 KB | 发布时间: 2026-4-17 15:34

v1.3.0 最新 2026-4-17 15:34
**Added unit system selection (metric/imperial) via environment variable**

- Support for `GOOGLE_WEATHER_UNITS` environment variable to choose metric or imperial units.
- Weather output now displays values (temperature, wind, etc.) in the selected unit system.
- Documentation updated: details and example outputs for both metric and imperial modes.
- No code changes required for unit switching—set the environment variable and restart.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部