# Observer location

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:

{% code lineNumbers="true" %}

```javascript
 axios({
	"method": "GET",
	"url": "https://api.radiantdrift.com/body-position/DATE_TIME_FROM",
 	"params": {
		"body": "[BODIES]",
		"obs": "LAT,LNG,HEIGHT"
	},
})
```

{% endcode %}

{% code overflow="wrap" lineNumbers="true" %}

```shell
curl "https://api.radiantdrift.com/body-position/DATE_TIME_FROM/?obs=LAT,LNG,HEIGHT&body=BODIES"
```

{% endcode %}

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

{% code overflow="wrap" fullWidth="false" %}

```
GET https://api.radiantdrift.com/body-position/2025-03-21T13:04:30Z/?obs=40.009728,-105.237709,1612&body=moon
```

{% endcode %}

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.

```json
{
  "query": {
    "name": "body-position",
    "start-date": "2025-03-21T13:04:30.000Z",
    "obs": {
      "lat": 40.009728,
      "lng": -105.237709,
      "height": 1612
    },
    "alg": "standard",
    "high-accuracy": false,
    "body": [
      "moon"
    ],
    "ra-decl": null,
    "extras": [],
    "interval": 60
  },
  "response": {
    "2025-03-21T13:04:30.000Z": {
      "moon": {
        "dateTD": "2025-03-21T13:05:39.073Z",
        "jde": 2460756.04559112,
        "eclipticCoordinates": {
          "λ": 260.52729877,
          "β": -5.25429849
        },
        "geocentricSphericalCoordinates": {
          "λ": 260.52729877,
          "β": -5.25429849,
          "Δ": 398136.53563773
        },
        "apparentCoordinates": {
          "ra": -100.73114387,
          "decl": -28.34079256
        },
        "apparentLongitude": 260.52750373,
        "obliquityOfEcliptic": 23.43866925,
        "radiusVector": 13135.97563773,
        "nutationInLongitude": 0.00020496,
        "nutationInObliquity": 0.00265718,
        "equatorialHorizontalParallax": 0.91791617,
        "meanElongation": 267.39595465,
        "meanAnomalySun": 75.93822925,
        "meanAnomalyMoon": 237.2096644,
        "argOfLatitude": 269.42006603,
        "localHorizontal": {
          "true": {
            "azimuth": 190.28208172,
            "altitude": 20.04241573
          },
          "apparent": {
            "azimuth": 190.28208172,
            "altitude": 20.08140602
          },
          "parallax": {
            "azimuth": 0,
            "altitude": 0.85634116
          },
          "refraction": 0.0389903
        }
      }
    }
  }
}
```

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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.radiantdrift.com/body-position/observer-location.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
