360 Secure SkillHub
360 安全技能中心

数联互通weather

该 Skill 用 curl 调用 WeatherAPI.com 的 current、forecast、search 接口,按地点返回实时天气、未来多日预报和地点搜索结果,输出 JSON。需要用户自行申请并配置 WEATHER_API_KEY,未配置则不可用;无内置默认密钥。

jianmo1997
jianmo1997
热度 63.87
最近更新 2026-05-17 12:58:22
分类:生活依赖:第三方 API / 代码执行应用场景:旅行

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add shulian-weather
Metadata
name
shulian-weather
description
Get current weather and forecasts via WeatherAPI.com. Use when: user asks about weather, temperature, or forecasts for any location. IMPORTANT: You must configure your own API key in OpenClaw settings or config file before using this skill.
homepage
https://www.weatherapi.com/
author
tanluzhe
license
MIT
version
1.0.0
metadata
{"openclaw":{"emoji":"🌦️","requires":{"bins":["curl"]},"primaryEnv":"WEATHER_API_KEY"}}

WeatherAPI.com Skill

Get current weather conditions and forecasts using WeatherAPI.com.

⚠️ IMPORTANT: Configure Your API Key First

This skill will NOT work until you configure your own API key.

Where to Get API Key

  1. Visit WeatherAPI.com
  2. Sign up for a free account
  3. Copy your API key from the dashboard
  4. Configure it using one of the methods below

Free tier: 1,000,000 calls/month

Configuration

Option 1: OpenClaw UI (Recommended)

  1. Open OpenClaw Control UI: http://127.0.0.1:18789
  2. Go to Skills section
  3. Find shulian-weather skill
  4. Click Configure button
  5. Enter your API key
  6. Save

Option 2: Config File

Edit ~/.openclaw/openclaw.json:

{
  "skills": {
    "entries": {
      "shulian-weather": {
        "enabled": true,
        "apiKey": "YOUR-API-KEY-HERE"
      }
    }
  }
}

Option 3: Environment Variable

Add to ~/.zshrc:

export WEATHER_API_KEY="YOUR-API-KEY-HERE"

Then restart Gateway.

Usage

After configuring your API key, you can ask:

  • "What's the weather in Shanghai?"
  • "Will it rain in Beijing tomorrow?"
  • "Weather forecast for New York this week"

Commands

Current Weather

API_KEY="${WEATHER_API_KEY}"
curl -s "https://api.weatherapi.com/v1/current.json?key=${API_KEY}&q=London"

Forecast

API_KEY="${WEATHER_API_KEY}"
curl -s "https://api.weatherapi.com/v1/forecast.json?key=${API_KEY}&q=London&days=7"

Search

API_KEY="${WEATHER_API_KEY}"
curl -s "https://api.weatherapi.com/v1/search.json?key=${API_KEY}&q=London"

Troubleshooting

"API key not configured" error

  1. Make sure you've configured your API key in OpenClaw UI or config
  2. Restart Gateway after configuration
  3. Check logs: tail -f ~/.openclaw/logs/gateway.log

Verify configuration

cat ~/.openclaw/openclaw.json | jq '.skills.entries."shulian-weather"'

Notes

  • API key is required - no default key provided
  • Supports worldwide locations
  • Returns JSON format
  • Free tier: 1,000,000 calls/month