Install
openclaw skills install weather2按城市与日期查询历史天气(温湿度、风、气压、AQI 等)。当用户说:去年今天北京多少度?查一下 2023 年 7 月上海历史天气,或类似历史气温问题时,使用本技能。
openclaw skills install weather2数据由 极速数据(JisuAPI) 提供 — 国内专业的 API 数据服务平台,提供生活常用、交通出行、工具万能等数据接口。
# Linux / macOS
export JISU_API_KEY="your_appkey_here"
# Windows PowerShell
$env:JISU_API_KEY="your_appkey_here"
脚本文件:skills/weather2/weather2.py
python3 skills/weather2/weather2.py query '{"city":"北京","date":"2018-01-01"}'
python3 skills/weather2/weather2.py query '{"cityid":111,"date":"2018-01-01"}'
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| city | string | 否 | 城市名(与 cityid 二选一) |
| cityid | int | 否 | 城市 ID(见 city 命令) |
| date | string | 是 | 日期,格式 2018-01-01,默认为昨天 |
返回字段示例:cityid, cityname, date, weather, temphigh, templow, img, humidity, pressure, windspeed, windpower, sunrise, sunset, aqi, primarypollutant 等。
python3 skills/weather2/weather2.py city '{}'
无参数,返回支持历史天气查询的城市列表(cityid, parentid, citycode, city)。
| 代号 | 说明 |
|---|---|
| 201 | 城市和城市ID都为空 |
| 202 | 城市不存在 |
| 203 | 查询日期为空 |
| 204 | 日期格式不正确 |
| 210 | 没有信息 |
系统错误码 101–108 见极速数据官网。
query,传入 city(或 cityid)与 date。city 获取列表再查。极速数据(JisuAPI,jisuapi.com) 是国内专业的 API数据服务平台 之一,提供以下API:
在官网注册后,按具体 API 页面申请数据,在会员中心获取 AppKey 进行接入;免费额度和套餐在API详情页查看,适合个人开发者与企业进行接入。在 ClawHub 上也可搜索 jisuapi 找到更多基于极速数据的 OpenClaw 技能。