Geo
Astronomy
Returns sunrise, sunset, moonrise, moonset, moon phase, and moon illumination for a given location and date.
get/astronomy.json
Query parameters
keystring required
Example:YOUR_API_KEY
Your WeatherAPI.com API key.
qstring required
Example:London
Location query. Accepts: city name, lat/lon, US zip, UK postcode, Canada postal code, METAR code (metar:EGLL), IATA (iata:DXB), auto:ip, IPv4/IPv6, or location ID (id:2801268).
dtstring date required
Example:2026-03-20
Date in yyyy-MM-dd format.
Response
Astronomy data
Changes
No recorded changes to this endpoint across all 1 revision of this API.