get_sun_moon_data
Retrieve sun and moon rise/set times, moon phase, and illumination data for any location and date to plan outdoor activities, photography, or astronomical observations.
Instructions
Get complete sun and moon data for one day at a specific location.
Provides rise, set, and transit times for the sun and moon, twilight times, moon phase, and illumination percentage. Essential for planning outdoor activities, photography, navigation, and astronomical observations.
Args: date: Date in YYYY-MM-DD format. No leading zeros required. latitude: Latitude in decimal degrees. Range: -90 to 90 (negative = South, positive = North) longitude: Longitude in decimal degrees. Range: -180 to 180 (negative = West, positive = East) timezone: Timezone offset from UTC in hours (e.g., -8 for PST, 1 for CET). Positive = East of UTC, Negative = West of UTC. If not provided, UTC (0) is used. dst: Whether to apply daylight saving time adjustment. If not provided, defaults to false. label: Optional user label (max 20 characters) to identify this query in the response
Returns: OneDayResponse: GeoJSON Feature containing: - geometry: Location coordinates - properties.data: Complete sun and moon information: - sundata: List of sun events (rise, set, transit, civil twilight begin/end) - moondata: List of moon events (rise, set, transit) - curphase: Current moon phase description - fracillum: Percentage of moon illuminated (e.g., "92%") - closestphase: Details of the nearest moon phase
Tips for LLMs: - Times are in the requested timezone (or UTC if not specified) - sundata and moondata may be empty in polar regions during extreme seasons - Civil twilight is when the sun is 6 degrees below horizon - Use fracillum to determine moon brightness for night photography or stargazing - Moon transit time indicates when moon is highest in the sky (best viewing)
Example: data = await get_sun_moon_data( date="2005-9-20", latitude=47.60, longitude=-122.33, timezone=-8, dst=True ) sunrise = next(e for e in data.properties.data.sundata if e.phen == "Rise") print(f"Sunrise at {sunrise.time}")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | ||
| latitude | Yes | ||
| longitude | Yes | ||
| timezone | No | ||
| dst | No | ||
| label | No |