← Back to docs
endpoints
POST astra/body/altitude-azimuth/

Altitude, azimuth, and compass direction for a celestial body at a datetime.

Astra Bodies

Overview

Returns the altitude and azimuth of any supported celestial body as seen from a specific location at a given date and time. Altitude is the angle above the horizon in degrees — a negative value means the body is below the horizon. Azimuth is the compass direction in degrees measured clockwise from north. The response also includes a plain-language compass direction (e.g. NNW) derived from the azimuth. Useful for determining whether a planet or the Moon is currently visible from a location and in which direction to look.


Request parameters

Name Type In Required Description Example
body Choice Body Yes The celestial body to query. Must be one of the Skyfield keys returned by the /astra/bodies/ endpoint (e.g. SUN, MOON, MARS). Case-sensitive.
date1 Date Body Yes The start date (or single query date) for the computation. Accepted formats: YYYY-MM-DD for date-only fields, ISO 8601 datetime string (YYYY-MM-DDTHH:MM) for datetime fields.
lat Float Body Yes Observer latitude in decimal degrees. Valid range: -90.0 (South Pole) to 90.0 (North Pole). Used to compute the observer's position on Earth's surface for all sky calculations.
lon Float Body Yes Observer longitude in decimal degrees. Valid range: -180.0 to 180.0. Negative values are west of the Prime Meridian, positive values are east.
timezone_slug Choice Body Optional Slug of a timezone record used to localise event datetimes in the response (e.g. america-new-york). When omitted, the timezone is derived automatically from the supplied coordinates. Obtain valid timezone slugs from the timezone list endpoint.

Response fields

Name Type Nullable Description Example
altitude Float Altitude of the body above the horizon in degrees. Negative values mean the body is below the horizon. 42.5
azimuth Float Azimuth of the body measured clockwise from true north, in degrees (0–360). 180.0
body String Skyfield key of the requested celestial body. MARS
date1 Datetime Observation datetime echoed from the request. 2025-06-21T14:00:00
formatted_altitude String Altitude formatted as a degree string (e.g. 42.5°). 42.5°
formatted_azimuth String Azimuth formatted with degrees and 16-point compass direction (e.g. 180.0° S). 180.0° S
is_visible Boolean True if the body's altitude is above the horizon (altitude > 0°). true
lat Float Observer latitude echoed from the request. 48.428333
lon Float Observer longitude echoed from the request. -123.364722
tz String Resolved IANA timezone name for the observer's location. America/Vancouver