返回顶部
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
安全检测
已通过
71
下载量
0
收藏
概述
安装方式
版本历史

weather-search

# Weather Search Skill Query real-time weather information using Amap (高德地图) Weather API. ## API Documentation https://lbs.amap.com/api/javascript-api/guide/services/weather ## Prerequisites 1. **Get Amap API Key** - Visit: https://console.amap.com/ - Create an application - Get your Web Service (Key) 2. **Set Environment Variable** ```bash export AMAP_API_KEY="your_api_key_here" ``` ## Usage ### Query Weather by City Name ```bash curl -X GET "https://restapi.amap.com/v3/weather/weatherInfo?city=BEIJING&key=YOUR_API_KEY&output=json" ``` ### Query Weather by City Code ```bash curl -X GET "https://restapi.amap.com/v3/weather/weatherInfo?city=110000&key=YOUR_API_KEY&output=json" ``` ### Query Multiple Cities ```bash curl -X GET "https://restapi.amap.com/v3/weather/weatherInfo?city=BEIJING|SHANGHAI|GUANGZHOU&key=YOUR_API_KEY&output=json" ``` ### Query by Coordinates (Latitude, Longitude) ```bash curl -X GET "https://restapi.amap.com/v3/weather/weatherInfo?location=116.40,39.90&key=YOUR_API_KEY&output=json" ``` ## API Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | city | String | Yes (or location) | City name or city code | | location | String | Yes (or city) | Format: longitude,latitude | | key | String | Yes | Amap API Key | | output | String | No | Response format: json or xml (default: json) | ## Response Example ```json { "status": "1", "infocode": "10000", "info": "Query Successful", "count": "1", "lives": [ { "province": "Beijing", "city": "Beijing", "adcode": "110000", "weather": "Clear", "temperature": "25", "winddirection": "North", "windpower": "2", "humidity": "45", "reporttime": "2024-01-15 12:00:00" } ] } ``` ## Quick Start Script Create a weather query script: ```bash #!/bin/bash # weather.sh API_KEY="${AMAP_API_KEY:-your_api_key_here}" CITY="$1" if [ -z "$CITY" ]; then echo "Usage: weather.sh <city_name_or_code>" exit 1 fi curl -s "https://restapi.amap.com/v3/weather/weatherInfo?city=${CITY}&key=${API_KEY}&output=json" | jq '.' ``` Make it executable: ```bash chmod +x weather.sh ./weather.sh BEIJING ``` ## City Code Reference | City | Code | |------|------| | Beijing | 110000 | | Shanghai | 310000 | | Guangzhou | 440100 | | Shenzhen | 440300 | | Hangzhou | 330100 | | Chengdu | 510100 | | Wuhan | 420100 | | Xi'an | 610100 | ## Notes - API Key is required for all requests - Free tier: 1000 requests/day - Response includes: weather condition, temperature, wind direction, wind power, humidity - Supports both Chinese city names and city codes

标签

skill ai

通过对话安装

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

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

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

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

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

通过命令行安装

skillhub install weather-search-1776101102

下载 Zip 包

⬇ 下载 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
返回顶部