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.
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.
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.
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.
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
The One Call API 3.0 is not included in the free tier and requires a paid subscription even if you are under the call volume limit; many developers assume it is free and receive 401 errors when calling it with a free-tier key.
City name lookups in the weather endpoint are ambiguous (many cities share names); always use lat/lon coordinates obtained from the Geocoding API (https://api.openweathermap.org/geo/1.0/direct) for reliable results.
The free tier allows 1,000 calls/day (60 calls/minute); a single page load that calls the API without caching for each user will exhaust this limit quickly, and the API returns 429 errors when the limit is hit.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp