🗓️Events

Get celestial events for a given body for the given date range.

Events API can return events for a single body for the given date range. In the events API currently, only the bodies Sun and Moon are supported.

See Event Properties for available event properties for bodies.

Get events for the given body

GET https://api.astronomyapi.com/api/v2/bodies/events/:body

Returns events for the given body for the given date range in tabular format.

Path Parameters

NameTypeDescription

body*

string

ID of the body

Query Parameters

NameTypeDescription

latitude*

string

Latitude of the observer's location

longitude*

string

Longitude of the observer's location

elevation*

string

Elevation from the sea in Meters

from_date*

string

Starting date as Date. The maximum number of days you can query is 366 days.

to_date*

string

Ending date as Date. The maximum number of days you can query is 366 days.

time*

string

Observer's time as Time

output

string

Output format.

rows

or

table

. Default is

table

Headers

NameTypeDescription

Authorization*

string

Basic

{
    "data": {
        "dates": {
            "from": "2020-12-20T09:00:00.000-05:00",
            "to": "2021-12-23T09:00:00.000-05:00"
        },
        "observer": {
            "location": {
                "longitude": -84.39733,
                "latitude": 38.775867,
                "elevation": 0
            }
        },
        "rows": [
            {
                "body": {
                    "id": "sun",
                    "name": "Sun"
                },
                "events": [
                    {
                        "type": "partial_solar_eclipse",
                        "eventHighlights": {
                            "partialStart": {
                                "date": "2021-06-10T03:45:15.241-05:00",
                                "altitude": -13.56
                            },
                            "totalStart": null,
                            "peak": {
                                "date": "2021-06-10T04:37:30.267-05:00",
                                "altitude": -5.85
                            },
                            "totalEnd": null,
                            "patialEnd": {
                                "date": "2021-06-10T05:32:52.677-05:00",
                                "altitude": 2.92
                            }
                        },
                        "rise": "2021-06-10T10:12:14.143Z",
                        "set": "2021-06-11T01:02:13.766Z",
                        "extraInfo": {
                            "obscuration": 0.76
                        }
                    }
                ]
            }
        ]
    }
}

Last updated