Fetch current weather and forecasts from OpenWeatherMap API with correct units and caching

domain: openweathermap · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Sign up at openweathermap.org and obtain an API key from the dashboard; new API keys can take up to a few hours to activate after generation.
  2. Fetch current weather by GETting https://api.openweathermap.org/data/2.5/weather?q={city}&appid={key}&units={metric|imperial|standard}; units defaults to standard (Kelvin) if omitted.
  3. Fetch a 5-day/3-hour forecast by GETting https://api.openweathermap.org/data/2.5/forecast?lat={lat}&lon={lon}&appid={key}&units={units}; using lat/lon is more reliable than city name for disambiguation.
  4. For the One Call API 3.0 (current + hourly + daily + alerts in one call), use https://api.openweathermap.org/data/3.0/onecall?lat={lat}&lon={lon}&appid={key}&units={units}&exclude={blocks}; this requires a separate subscription from the free tier.
  5. Cache API responses on your server for at least 10 minutes; weather data does not change faster than this, and unnecessary calls will consume your request quota.

Known gotchas

Related routes

Retrieve free weather data for renewables forecasting using the Open-Meteo API
api.open-meteo.com · 5 steps · unrated
Fetch an aggregated historical or future daily weather summary for a date using OpenWeather's One Call API 3.0 day_summary endpoint
api.openweathermap.org · 5 steps · unrated
Retrieve individual ensemble member forecasts for a location from Open-Meteo's Ensemble API
ensemble-api.open-meteo.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans