How to hit the WeatherAPI.com API

WeatherAPI.com at https://api.weatherapi.com/v1 serves current weather, forecasts, history, air quality, and astronomy. q takes a city, coordinates, postal code, or IP.

Authentication

Sign up at weatherapi.com and pass your key as key. In the examples it's written {{WEATHERAPI_KEY}}.

Full reference: https://www.weatherapi.com/docs/

Current weather

aqi=yes adds air quality.

curl "https://api.weatherapi.com/v1/current.json?key={{WEATHERAPI_KEY}}&q=London&aqi=yes"
Run in PostTaco

3-day forecast

curl "https://api.weatherapi.com/v1/forecast.json?key={{WEATHERAPI_KEY}}&q=Boulder&days=3"
Run in PostTaco

Sunrise, sunset, moon phase

curl "https://api.weatherapi.com/v1/astronomy.json?key={{WEATHERAPI_KEY}}&q=Tokyo&dt=2026-09-23"
Run in PostTaco