360 Secure SkillHub
360 安全技能中心

Hong Kong Weather

通过本地 Python 脚本调用香港天文台开放数据接口,获取香港实时天气(温度、湿度、降雨、紫外线指数)、生效天气警告(台风、暴雨、雷暴等)及九天预报,支持繁体中文与英文输出,无需 API 密钥。仅限香港地区,不含全球天气与历史气候数据。

mic007p
mic007p
热度 37.66
最近更新 2026-05-11 17:45:10
分类:生活依赖:代码执行 / 第三方 API应用场景:旅行

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add hk-weather
Metadata
name
hk-weather
description
Hong Kong weather information from the Hong Kong Observatory (HKO) official open data API. Use when: user asks about Hong Kong weather, temperature, rainfall, UV index, weather warnings (typhoon, rainstorm, thunderstorm), or 9-day forecast. NOT for: global weather, historical climate data, or non-HK locations. Supports Traditional Chinese and English output. No API key needed.
metadata
{"openclaw":{"emoji":"🌤️","requires":{"bins":["python3"]},"keywords":["hong kong weather","hk weather","香港天氣","天文台","hko","typhoon","rainstorm","暴雨警告","颱風","紫外線","uv index","temperature","降雨量","forecast","預報"],"locale":["zh-HK","en"],"category":"weather","quality":{"latency":"2-5s","fallback":true},"securityNotes":{"purpose":"Read-only weather query from HKO official open data","allowedDomains":["data.weather.gov.hk"],"writeScope":["scripts/__pycache__/"],"noSecrets":true}}}

Hong Kong Weather (v1.0.0)

Get real-time weather, warnings, and forecasts from the Hong Kong Observatory (HKO) official open data API. Zero dependencies, zero API keys.

Output Policy (Safe & ClawHub-friendly)

  • Prefer script output as reply basis.
  • Allow minimal formatting cleanup for readability.
  • Never fabricate weather data. If API fails, show exact error.
  • Keep output concise. No lengthy explanations.

Safety & Scope (for Security Scan)

  • Allowed commands only:
    • python3 scripts/hk_weather.py current [tc|en]
    • python3 scripts/hk_weather.py warning [tc|en]
    • python3 scripts/hk_weather.py forecast [tc|en]
    • python3 scripts/hk_weather.py all [tc|en]
  • Network scope (allowlist):
    • https://data.weather.gov.hk/*
  • Write scope (skill-local only):
    • scripts/__pycache__/
  • No secrets. No credentials. No config files.

Language Handling

  • Chinese query → tc: When user asks in Chinese/Cantonese, use python3 scripts/hk_weather.py current tc
  • English/non-Chinese query → en: When user asks in English, use python3 scripts/hk_weather.py current en
  • Default to tc if language is unclear (Hong Kong primary language)

Usage

Current Weather

Real-time temperature, humidity, rainfall, UV index, and conditions.

# Chinese output (default for HK)
python3 scripts/hk_weather.py current tc

# English output
python3 scripts/hk_weather.py current en

Weather Warnings

Check active warnings (typhoon, rainstorm, thunderstorm, etc.).

python3 scripts/hk_weather.py warning tc
python3 scripts/hk_weather.py warning en

9-Day Forecast

Extended forecast with temperature range, humidity, and rain probability.

python3 scripts/hk_weather.py forecast tc
python3 scripts/hk_weather.py forecast en

All-in-One

Combined current + warnings + forecast (first 3 days).

python3 scripts/hk_weather.py all tc
python3 scripts/hk_weather.py all en

Examples

"今天香港天氣點?"

python3 scripts/hk_weather.py current tc

"What's the weather in Hong Kong?"

python3 scripts/hk_weather.py current en

"有冇暴雨警告?"

python3 scripts/hk_weather.py warning tc

"Forecast for the week"

python3 scripts/hk_weather.py forecast en

"香港天氣點?有冇警告?未來幾日預報?"

python3 scripts/hk_weather.py all tc

Notes

  • Data source: Hong Kong Observatory Open Data API (data.weather.gov.hk)
  • No API key required
  • Response time: typically 2-5 seconds
  • When no warnings are active, the warning command returns "No active weather warnings" / "現時無生效天氣警告"