← 返回
开发者工具 中文

Weather Open‑Meteo

Get current weather and forecasts via open-meteo.com with optional fallback to wttr.in if available. No API key required.
通过 open-meteo.com 获取当前天气与预报,可备用 wttr.in。无需 API 密钥。
vdiogov
开发者工具 clawhub v0.1.5 1 版本 100000 Key: 无需
★ 0
Stars
📥 1,034
下载
💾 26
安装
1
版本
#latest

概述

Weather Open‑Meteo Skill

This skill provides current weather and simple forecasts by querying the open‑meteo.com public API. If the geocoding lookup or weather request fails, the skill can fall back to wttr.in as a lightweight alternative.

📌 Scope & Caveats

  • The skill requires curl and jq.
  • Location parameters are encoded before being sent to the API.
  • Examples below demonstrate safe query construction using jq @uri.

✅ When to Use

The user asks for weather, forecast, temperature, or rain probability for a location.

✖ Not for historical data, severe alerts, or detailed climatology.

📋 Commands

The skill accepts a single argument: a location name (city, region, or coordinates in lat,lon).

Open‑Meteo (primary, JSON)

Geocoding (co‑ordinates for a place):

curl -s "https://geocoding-api.open-meteo.com/v1/search?name=São+Paulo\u0026count=1" | jq '.results[0] | {name, latitude, longitude}'

Current weather (by co‑ordinates):

curl -s "https://api.open-meteo.com/v1/forecast?latitude=-23.55\u0026longitude=-46.63\u0026current_weather=true" | jq '.current_weather'

7‑day forecast (by co‑ordinates):

curl -s "https://api.open-meteo.com/v1/forecast?latitude=-23.55\u0026longitude=-46.63\u0026daily=temperature_2m_max,temperature_2m_min,precipitation_sum\u0026forecast_days=7" | jq '.daily'

Example JSON excerpt

{
  "latitude": -23.55,
  "longitude": -46.63,
  "current_weather": {
    "temperature": -5.3,
    "windspeed": 3.9,
    "winddirection": 200,
    "weathercode": 80,
    "time": "2024-02-18T14:00"
  }
}

📖 Open‑Meteo API docs

wttr.in (fallback)

One‑liner (HTML text):

curl -s "wttr.in/São+Paulo?format=3"

Compact plain‑text:

curl -s "wttr.in/São+Paulo?format=1"

PNG image (for terminals or embeds):

curl -s -o sp.png "http://wttr.in/São+Paulo?format=1"

📚 Example (User Query)

> User: What's the weather in São Paulo?

> Agent:

> Current conditions in São Paulo: 🌤️ +10 °C, 20% chance of rain

Tips

  • URL‑encode city names:

```bash

curl -s "https://geocoding-api.open-meteo.com/v1/search?name=$(echo São Paulo | jq -sRr @uri)"

```

  • Use jq to build the query dynamically:

```bash

city="São Paulo"

lat=$(curl -s "https://geocoding-api.open-meteo.com/v1/search?name=$(echo $city | jq -sRr @uri)" | jq -r '.results[0].latitude')

lon=$(curl -s "https://geocoding-api.open-meteo.com/v1/search?name=$(echo $city | jq -sRr @uri)" | jq -r '.results[0].longitude')

```

  • You can pass latitude and longitude directly if you know them.
  • The API is rate‑limited (≈100 requests/min). Keep scripts cached or use short intervals.

版本历史

共 1 个版本

  • v0.1.5 当前
    2026-03-29 05:58 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,189
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,801
developer-tools

Agent Browser

matrixy
专为AI智能体优化的无头浏览器自动化CLI,支持无障碍树快照和基于引用的元素选择。
★ 427 📥 118,203