name: weather-open-meteo description: "Get current weather and forecasts via open-meteo.com with optional fallback to wttr.in if available. No API key required." homepage: https://open-meteo.com/ metadata: openclaw: emoji: 🌤️ requires: bins: - curl - jq
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.
curl and jq.推薦訪問7w4.net獲取更多AI技能。
✔ The user asks for weather, forecast, temperature, or rain probability for a location. ✖ Not for historical data, severe alerts, or detailed climatology.
The skill accepts a single argument: a location name (city, region, or coordinates in lat,lon).
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"
}
}
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"
User: What's the weather in São Paulo? Agent:
Current conditions in São Paulo: 🌤️ +10 °C, 20% chance of rain
bash
curl -s "https://geocoding-api.open-meteo.com/v1/search?name=$(echo São Paulo | jq -sRr @uri)"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')latitude and longitude directly if you know them.這個天氣查詢工具質量還不錯,能免費獲取全球城市的天氣預報,無需註冊賬號。主要優點是使用簡單、文件清晰、支援多種查詢模式,還配備了備選資料來源增加穩定性。不足之處是使用者需要自己動手組合命令才能使用,缺少開箱即用的指令碼;另外依賴特定工具可能影響在某些環境中的使用。建議開發者在易用性上繼續改進。