Astronomy Time Series
get_astronomy_time_seriesRetrieve daily sunrise, sunset, moonrise, moonset, and moon phase data for any location over a date range up to 90 days.
Instructions
Read-only daily astronomy series via GET /v3/astronomy/timeSeries. Works on free and paid plans. Cost: 1 credit per request. Use for date ranges up to 90 days; use get_astronomy for one date or real-time sun/moon position.
Returns { location, astronomy: [...] } with one daily item per date containing sunrise/sunset, moonrise/moonset, twilight blocks, day_length, sun/moon status, and moon_phase. Selector priority is lat/long, location, ip, then caller IP when no selector is provided.
dateStart and dateEnd are required YYYY-MM-DD values with a maximum 90-day span. lat and long must be provided together; elevation must be 0-10000 meters. time_zone changes timestamp formatting to include full dates. lang only changes location fields; non-English lang is paid-only and returns 401 on free plans. force_refresh bypasses cache and makes a fresh upstream request only when the user asks.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ip | No | IPv4 or IPv6 address to get astronomy data for that IP's location. | |
| lat | No | Latitude coordinate. Highest priority. Must be used with long. | |
| lang | No | Response language for location fields in IP-based lookups (en, de, ru, ja, fr, cn, es, cs, it, ko, fa, pt). Paid plans only. Free plan returns 401 for non-English languages. | |
| long | No | Longitude coordinate. Must be used with lat. | |
| dateEnd | Yes | End date in YYYY-MM-DD format. Required. Maximum range between dateStart and dateEnd is 90 days. | |
| location | No | City or address string (e.g. San Francisco, CA). | |
| dateStart | Yes | Start date in YYYY-MM-DD format. Required. Maximum range between dateStart and dateEnd is 90 days. | |
| elevation | No | Elevation in meters above sea level (0-10000). Affects sunrise/sunset calculations. | |
| time_zone | No | IANA timezone name to express times in (e.g. America/New_York). If set, time fields include full date instead of just time. | |
| force_refresh | No | Default false. Set true only when the user asks to refresh cached astronomy time-series data; a successful refresh makes a new upstream request and can consume credits. |