> For the complete documentation index, see [llms.txt](https://docs.radiantdrift.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.radiantdrift.com/body-position/positions-for-a-time-range.md).

# Positions for a time range

Use the `body-position` end point to obtain the position (and related values) of the Sun, Moon, and/or the Galactic Center in a variety of astronomical coordinate systems.

If both `DATE_TIME_FROM` and `DATE_TIME_TO` are specified, the API returns values for the given time range at a default time interval of 60 seconds.

You can override the default interval by supplying your own value for the `interval`query parameter.

The following example calculates the position of Sun every five minutes from 12pm UTC to 1pm UTC on Sep 1 2023:

{% code overflow="wrap" %}

```
GET https://api.radiantdrift.com/body-position/2023-09-01T12:00:00Z/2023-09-01T13:00:00Z/?body=sun&interval=300
```

{% endcode %}

The `response` property is a dictionary of calculated body positions at the request times/intervals.  An excerpt of the response is:

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

```json
{
  "query": {
    "name": "body-position",
    "start-date": "2023-09-01T12:00:00.000Z",
    "end-date": "2023-09-01T13:00:00.000Z",
    "obs": null,
    "alg": "standard",
    "high-accuracy": false,
    "body": [
      "sun"
    ],
    "ra-decl": null,
    "extras": [],
    "interval": 300
  },
  "response": {
    "2023-09-01T12:00:00.000Z": {
      "sun": {
        "dateTD": "2023-09-01T12:01:09.140Z",
        "jde": 2460189.00080023,
        "eclipticCoordinates": {
          "λ": 158.80751482,
          "β": 0
        },
        "apparentCoordinates": {
          "decl": 8.26737356,
          "ra": 160.41792175
        },
        "apparentLongitude": 158.80751482,
        "radiusVector": 1.00927514,
        "obliquityOfEcliptic": 23.43621354,
        "equatorialHorizontalParallax": 0.00242033
      }
    },
    "2023-09-01T12:05:00.000Z": {
      "sun": {
        "dateTD": "2023-09-01T12:06:09.140Z",
        "jde": 2460189.00427245,
        "eclipticCoordinates": {
          "λ": 158.81087415,
          "β": 0
        },
        "apparentCoordinates": {
          "decl": 8.26611461,
          "ra": 160.42106895
        },
        "apparentLongitude": 158.81087415,
        "radiusVector": 1.00927432,
        "obliquityOfEcliptic": 23.43621354,
        "equatorialHorizontalParallax": 0.00242033
      }
    },
    "2023-09-01T12:10:00.000Z": {
      "sun": {
        "dateTD": "2023-09-01T12:11:09.140Z",
        "jde": 2460189.00774468,
        ...
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.radiantdrift.com/body-position/positions-for-a-time-range.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
