--- name: weather-forecasts description: Get current weather and forecasts (no API key required). homepage: https://wttr.in/:help metadata: {"clawdbot":{"emoji":"🌤️","requires":{"bins":["curl"]}}} --- # Weather Two free services, no API keys needed. ## wttr.in (primary) Quick one-liner: ```bash curl -s "wttr.in/London?format=3" # Output: London: ⛅️ +8°C ``` Compact format: ```bash curl -s "wttr.in/London?format=%l:+%c+%t+%h+%w" # Output: London: ⛅️ +8°C 71% ↙5km/h ``` Full forecast (3 days): ```bash curl -s "wttr.in/London?T" ``` ### Querying by time range Current weather only: ```bash curl -s "wttr.in/London?0&format=3" ``` Today's forecast: ```bash curl -s "wttr.in/London?1&T" ``` Tomorrow's forecast: ```bash curl -s "wttr.in/London?2&T" # Shows today + tomorrow; extract the second day ``` Day after tomorrow: ```bash curl -s "wttr.in/London?T" # Default output shows 3 days (today, tomorrow, day after tomorrow) ``` Next 7 days (weekly forecast) — use Open-Meteo: ```bash curl -s "https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.12&daily=temperature_2m_max,temperature_2m_min,weathercode&timezone=auto&forecast_days=7" ``` ### Format codes `%c` condition · `%t` temp · `%h` humidity · `%w` wind · `%l` location · `%m` moon ### Tips - URL-encode spaces: `wttr.in/New+York` - Airport codes: `wttr.in/JFK` - Units: `?m` (metric) `?u` (USCS) - Language: `?lang=ja` (Japanese), `?lang=zh` (Chinese), etc. - PNG: `curl -s "wttr.in/Berlin.png" -o /tmp/weather.png` ## Open-Meteo (fallback / extended forecasts, JSON) Free, no key, good for programmatic use and longer-range forecasts. Current weather: ```bash curl -s "https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.12¤t_weather=true" ``` 7-day daily forecast (min/max temp, weather code): ```bash curl -s "https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.12&daily=temperature_2m_max,temperature_2m_min,weathercode,precipitation_sum&timezone=auto&forecast_days=7" ``` Hourly forecast for the next 2 days: ```bash curl -s "https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.12&hourly=temperature_2m,weathercode,precipitation&timezone=auto&forecast_days=2" ``` Find coordinates for a city, then query. Returns JSON with temp, windspeed, weathercode. Docs: https://open-meteo.com/en/docs