How to hit the OpenWeatherMap API

OpenWeatherMap's API lives at https://api.openweathermap.org. The key goes in the query string as appid; units=metric or imperial avoids temperatures in Kelvin.

Authentication

Sign up and copy your key from API keys. New keys can take a couple of hours to activate. In the examples it's written {{OPENWEATHER_API_KEY}}.

Full reference: https://openweathermap.org/api

Current weather

curl "https://api.openweathermap.org/data/2.5/weather?q=London&units=metric&appid={{OPENWEATHER_API_KEY}}"
Run in PostTaco

5-day forecast

Every 3 hours.

curl "https://api.openweathermap.org/data/2.5/forecast?lat=40.71&lon=-74.01&units=imperial&cnt=4&appid={{OPENWEATHER_API_KEY}}"
Run in PostTaco

City to coordinates

curl "https://api.openweathermap.org/geo/1.0/direct?q=Boulder,CO,US&limit=1&appid={{OPENWEATHER_API_KEY}}"
Run in PostTaco