Get current weather by city
Fetch current weather observations by city name, URL-encode multi-word queries, disambiguate duplicate names with state and country codes, and localize descriptions.
Get a 5-day forecast
Fetch 5-day weather forecasts in 3-hour intervals, cap payload size with cnt, and aggregate intervals into timezone-accurate daily high and low summaries.
Use geographic coordinates
Resolve place names to latitude and longitude with Geocoding API 1.0, reverse-geocode coordinates to city labels, and pass browser geolocation safely through your backend.
Handle errors in production
Inspect HTTP status codes safely, avoid JSON parse crashes on HTML 502 and 503 gateway pages, and retry transient 429 and 5xx errors with exponential backoff.
Set up rate limiting and caching
Protect your OpenWeatherMap API key and stay within the 60 requests per minute quota by building a bounded 10-minute caching proxy and throttling batch jobs.