API


Sun & Moon

Basic Flow

To generate a sun & moon information from AstroAPI, the system (your implementation) makes a POST-request to the /api/sunmoon endpoint with the necessary parameters. With correct parameters the AstroAPI will provide a the sun & moon information in JSON-format.

Request

POST /api/sunmoon

Header Value
Accept-Encoding application/json
Content-Type application/json
Authorization Bearer [accessToken]


body

{
    "date": "2021-01-01",
    "time": "14:00",
    "place_id": 1250015082
}


Params explanation

Header Value
date The date in format YYYY-mm-dd
time The time in format HH:mm
place_id The place retrieved from the /api/places request

Response

{
  "moon": {
    "phase": 0.5792533706990883,
    "phaseName": "Waning Gibbous",
    "age": 17.1,
    "stage": "waning",
    "distance": 382701.77,
    "illumination": 0.9392785184541468,
    "diameterInDegrees": 0.520400411456603
  },
  "sun": {
    "distance": 147098069.1259154,
    "diameterInDegrees": 0.542190319573331,
    "sunrise": "07:43:52",
    "sunset": "16:04:40",
    "transit": "11:54:16",
    "civilTwilightBegin": "07:07:03",
    "civilTwilightEnd": "16:41:29",
    "nauticalTwilightBegin": "06:26:50",
    "nauticalTwilightEnd": "17:21:42",
    "astronomicalTwilightBegin": "05:48:28",
    "astronomicalTwilightEnd": "18:00:03"
  }
}