AstronomyAPI
  • 🚀Getting Started
  • API v2 Reference
    • 🪐Bodies
      • 🌐Positions
      • 🗓️Events
    • 📸Studio
      • ✨Star Chart
      • 🌒Moon Phase
    • 🔎Search
  • 🤝Requests and Responses
    • 🪐Body Properties
    • 🕚Event Properties
    • 🔎Search Result Properties
    • 🔭Observer Parameters
    • 🗓️Tabular Responses
    • 🔢Rows Responses
    • 🚩Error Responses
    • 🔢Constellation Enums
    • 🔢DSO Enums
  • Page
  • 🧩Widgets
  • ⚠️Known Issues
  • 📕Changelog
  • Links
    • demo.astronomyapi.com
    • Sample code on Github
    • Back to Dashboard
Powered by GitBook
On this page

Was this helpful?

  1. API v2 Reference
  2. Bodies

Events

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

PreviousPositionsNextStudio

Last updated 1 year ago

Was this helpful?

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 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

Name
Type
Description

body*

string

ID of the body

Query Parameters

Name
Type
Description

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

Name
Type
Description

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
                        }
                    }
                ]
            }
        ]
    }
}
🪐
🗓️
Event Properties