Calculating local horizontal coordinates with respect to an observer
To calculate local horizontal coordinates (topocentric) for an observer located at an arbitrary location on (or above) the Earth's surface, include a suitable value for the obs query parameter:
LAT is the observer latitude in decimal degrees and LNG is the longitude (negative west). HEIGHT is the observer elevation above mean sea level, given in meters. If no elevation value is available, use zero (0m).
Example
The following query calculates the position of the Moon for March 21 2025 at 13:04:30 UTC as observed in Boulder, Colorado, USA:
GET https://api.radiantdrift.com/body-position/2025-03-21T13:04:30Z/?obs=40.009728,-105.237709,1612&body=moon
A localHorizontal object is included in the response, giving true and apparent azimuth/altitude coordinates for the observer, together with parallax and the effect of estimated refraction.
The effect of atmospheric refraction is generally to increase the altitude of the body for the observer, as seen in the example above. The effect is more pronounced near the horizon.