Astronomy
astronomyGet astronomy data for a location and date: sunrise, sunset, moonrise, moonset, moon phase, and moon illumination. Example: astronomy({ q: "Reykjavik", dt: "2026-06-21" }).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | Location — city name (e.g. "London"), "lat,lon" (e.g. "48.8567,2.3508"), US/UK/Canada zip/postcode, IATA airport code (e.g. "DXB"), or "auto:ip". NOTE on IATA codes: WeatherAPI resolves them to that airport's CITY, not the airport's own weather station — for the actual airport-station reading (can differ by several degrees) use the aviation-weather pack's metar tool with the airport's ICAO code instead. | |
| dt | No | Date in YYYY-MM-DD format (optional; defaults to today). | |
| _apiKey | No | Optional — your own WeatherAPI.com API key for higher limits; omit to use the shared Pipeworx key. |