Setup
Put them in your environment or
.env; Data APIs covers the other ways.
Notes
- Temperatures are Kelvin unless units=metric or imperial is passed.
- Every weather call takes lat/lon; resolve a place name or ZIP first with openweather.geocoding.direct or openweather.geocoding.zip (the q/id/zip lookups on the weather endpoints are deprecated).
- One Call 3.0 endpoints need the separate One Call API subscription (1,000 calls/day free, then billed per call); the 2.5 endpoints work on the free plan.
- Times (dt) are Unix seconds UTC; the response’s timezone field is the offset in seconds.
Endpoints
Geocode a place name
Geocode a ZIP or postal code
Reverse geocode coordinates
Get current weather
Get a 5-day forecast
Get current air pollution
Get historical air pollution
Get current weather and forecasts (One Call)
- Needs the One Call API subscription.
Get weather at a past or future time
- Needs the One Call API subscription.
Get a daily weather summary
- Needs the One Call API subscription.