返回顶部
w

weather-search天气查询

Query real-time weather information using Amap (高德地图) Weather API. Use when user asks about weather, temperature, wind, humidity for Chinese cities. Requires AMAP_API_KEY environment variable.

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

weather-search

天气查询技能

使用高德地图天气API查询实时天气信息。

API文档

https://lbs.amap.com/api/javascript-api/guide/services/weather

前置条件

  1. 1. 获取高德地图API密钥
- 访问:https://console.amap.com/ - 创建应用 - 获取Web服务密钥
  1. 2. 设置环境变量
bash export AMAPAPIKEY=yourapikey_here

使用方法

按城市名称查询天气

bash curl -X GET https://restapi.amap.com/v3/weather/weatherInfo?city=BEIJING&key=YOURAPIKEY&output=json

按城市编码查询天气

bash curl -X GET https://restapi.amap.com/v3/weather/weatherInfo?city=110000&key=YOURAPIKEY&output=json

查询多个城市

bash curl -X GET https://restapi.amap.com/v3/weather/weatherInfo?city=BEIJING|SHANGHAI|GUANGZHOU&key=YOURAPIKEY&output=json

按坐标查询(纬度,经度)

bash curl -X GET https://restapi.amap.com/v3/weather/weatherInfo?location=116.40,39.90&key=YOURAPIKEY&output=json

API参数

参数类型必填描述
city字符串是(或location)城市名称或城市编码
location
字符串 | 是(或city) | 格式:经度,纬度 | | key | 字符串 | 是 | 高德地图API密钥 | | output | 字符串 | 否 | 响应格式:json或xml(默认:json) |

响应示例

json
{
status: 1,
infocode: 10000,
info: 查询成功,
count: 1,
lives: [
{
province: 北京,
city: 北京,
adcode: 110000,
weather: 晴,
temperature: 25,
winddirection: 北,
windpower: 2,
humidity: 45,
reporttime: 2024-01-15 12:00:00
}
]
}

快速启动脚本

创建天气查询脚本:

bash
#!/bin/bash

weather.sh

APIKEY=${AMAPAPIKEY:-yourapikeyhere}
CITY=$1

if [ -z $CITY ]; then
echo 用法:weather.sh <城市名称或编码>
exit 1
fi

curl -s https://restapi.amap.com/v3/weather/weatherInfo?city=${CITY}&key=${API_KEY}&output=json | jq .

赋予执行权限:
bash
chmod +x weather.sh
./weather.sh BEIJING

城市编码参考

城市编码
北京110000
上海
310000 | | 广州 | 440100 | | 深圳 | 440300 | | 杭州 | 330100 | | 成都 | 510100 | | 武汉 | 420100 | | 西安 | 610100 |

注意事项

  • - 所有请求都需要API密钥
  • 免费额度:每天1000次请求
  • 响应包含:天气状况、温度、风向、风力、湿度
  • 支持中文城市名称和城市编码

标签

skill ai

通过对话安装

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

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 weather-search-1776101102 技能

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

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

通过命令行安装

skillhub install weather-search-1776101102

下载

⬇ 下载 weather-search v1.0.0(免费)

文件大小: 2.79 KB | 发布时间: 2026-4-14 14:34

v1.0.0 最新 2026-4-14 14:34
Initial release - weather query skill using Amap API for Chinese cities

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

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

p2p_official_large
返回顶部