# Getting Started

Welcome to **Astronomy API**, a web API for retrieving astronomical information.

## Obtaining an Application ID and a Secret

To make API calls, you will first need to create an account. Go to the [Signup](http://astronomyapi.com/auth/signup) page to create your free account.

After creating an account, you must obtain an `Application ID` and an `Application Secret` key by clicking the `"Create Application"` button from your dashboard. You will be directed to the "View Application" page for the application you just created.

The `Application Secret` is visible to you only once during application creation. Save it somewhere because there's no way to retrieve it back. If you lost your secret create a new application and delete the old application.

You will use the `Application ID` and the `Application Secret` to authenticate with the Astronomy API with Basic Authentication.

You can view your `Application ID` later, by clicking the name of the specific application on the [dashboard](http://astronomyapi.com/dashboard).

{% hint style="info" %}
Be sure to set the `Origin` to the domain of the website when creating an application. If you're planning to use the API on a webpage. The API will respond with a `Access Allow Origin` header with the domain you provide.

This is needed if you're calling the API from a web page client since web browsers need CORS setup for remote requests to work.
{% endhint %}

## Basic Authentication

When making API calls to endpoints requiring authentication, you must use the above credentials to create a string that must be used as the authentication string. The algorithm to create the string is very simple. Below are implementations of several commonly used languages.

#### JS

```typescript
const authString = btoa(`applicationId:applicationSecret`);
```

#### PHP

```php
$authString = base64_encode("applicationId:applicationSecret");
```

#### Python

```python
import base64
userpass = "applicationId:applicationSecret"
authString = base64.b64encode(userpass.encode()).decode()
```

The encrypted string must be provided in the API request's `Authorization` header, after the term `Basic` followed by a space.

```markup
"Authorization: Basic YourAuthStringHere"
```

In an event of an authentication failure, a `403 Forbidden` response will be returned, which probably means you encrypted the string incorrectly, or your credentials are wrong.

Successful requests always respond with HTTP code `200`.

### Sample curl request

```bash
curl --location --request GET 'https://api.astronomyapi.com/api/v2/bodies' 
\ --header 'Authorization: Basic YourAuthStringHere' 
```

For code samples and demos go to [demo.astronomyapi.com](http://demo.astronomyapi.com)

Need help with something? or noticed a bug? [Please create a ticket on Github](https://github.com/AstronomyAPI/Samples/issues)


# Overview

What changed in v3, and why

v3 is a breaking redesign of the request and response shapes. v2 is unchanged and continues to work; nothing here affects it.

{% hint style="info" %}
v3 is being built. These pages are published as each endpoint is settled, so that the design can be read and argued with before it ships. Anything not yet listed in the sidebar is still being written.
{% endhint %}

## Three conventions

Knowing these removes most of the surprises.

**Numbers are numbers.** v2 returned every figure as a string, so `"41.26"` had to be parsed back before it could be used. v3 uses the JSON number type.

**One representation per value.** v2 sent each angle twice: once as a number and once pre-formatted for display, as `"41° 15' 36\""`. It also sent the whole horizontal position twice, under `horizontal` and under a misspelled `horizonal`. v3 sends the number once. The formatted form is available on request through `include=formatted`, and the misspelling is gone.

**Units are declared, not implied.** Every response carries a `meta.units` block. Right ascension is in hours, following astronomical convention; every other angle is in degrees. v2 stated this nowhere.

Together these make a positions response about 60% smaller while carrying more information.

## Sampling

v2 returned one position per day, at a single time of day. Asking for an altitude curve meant twenty-four requests.

v3 takes `from` and `to` as instants and a `step` as an ISO 8601 duration, so one request covers whatever resolution is wanted:

```
?from=2024-06-21T00:00:00Z&to=2024-06-22T00:00:00Z&step=PT1H
```

`step=P1D` reproduces v2's behaviour exactly, and is the default.

## Time zones

v2 inferred the time zone from the observer's coordinates and gave no way to override it, so two callers asking about the same instant received differently labelled timestamps and neither could ask for UTC.

v3 takes an explicit `timezone`. `auto` keeps v2's behaviour and remains the default; `UTC` is the unambiguous choice.

## Errors

v2 returned the raw output of its schema validator, exposing internal paths such as `instance.latitude` and offering no stable code to branch on.

v3 returns [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem details as `application/problem+json`, with a stable `type` URI and a machine-readable code for each parameter at fault.

## Corrections

Two v2 responses were wrong rather than merely awkward, and v3 fixes both.

`extraInfo.phase.angel` was misspelled. It is `phase.angle` in v3.

`extraInfo.phase.fraction` was wrong twice over: it was scaled to a range of 0 to 0.067 instead of 0 to 1, and it ran backwards, reporting its largest value at new moon and zero at full. In v3 it is the fraction of the Moon's disc that is lit, from 0 at new to 1 at full.

## The bodies

The Sun, the Moon, and Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune and Pluto. The list is fixed, so v3 carries it in the specification rather than serving it: v2's `/bodies` endpoint spent a request to return ten constants that never change, and generated clients now get the ids as a type instead.

`earth` is not among them. Seen from the Earth it is at zero distance and has no direction, so the right ascension, declination, altitude and azimuth v2 reported for it were whatever fell out of the arithmetic. Asking for it returns 422.

## Moving across

See [Migrating from v2](/api-v3-reference-draft/v3/migrating-from-v2) for a field-by-field mapping.


# Positions

Where the Sun, the Moon and the planets are

Returns where each requested body appears from the observer's location, sampled between two instants.

One request covers as many bodies and as many instants as needed. Omit `bodies` to get all of them; set `step` to sample more finely than once a day.

{% openapi src="/files/I36OyRpmo4rQOx2DuT1k" path="/positions" method="get" %}
[astronomy-api-v3.yaml](https://1238588302-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKQ7_I-c79Ln1c6Chop-3789850253%2Fuploads%2Fgit-blob-c743ca2b9574a9aee2b1314404f74fd87c7a6cfc%2Fastronomy-api-v3.yaml?alt=media)
{% endopenapi %}

## Examples

Mars right now, from London:

```
GET /api/v3/positions?bodies=mars&latitude=51.4779&longitude=-0.0015
    &from=2024-06-21T11:00:00Z&to=2024-06-21T11:00:00Z
```

The Moon's altitude every fifteen minutes through a night, in UTC:

```
GET /api/v3/positions?bodies=moon&latitude=51.4779&longitude=-0.0015
    &from=2024-06-21T18:00:00Z&to=2024-06-22T06:00:00Z
    &step=PT15M&timezone=UTC
```

Everything visible, once a day for a week, with sexagesimal strings alongside the numbers:

```
GET /api/v3/positions?latitude=51.4779&longitude=-0.0015
    &from=2024-06-21&to=2024-06-28&step=P1D&include=formatted
```

## Notes

**`earth` is not available here.** Seen from the Earth it is at zero distance and has no direction, so v2's answer for it was arbitrary. Asking for it returns 422.

**Altitude may be negative.** A body below the horizon is a legitimate answer, not an error. Filter on `altitude > 0` if only what is up matters.

**Refraction is applied by default**, because that is where a body appears rather than where it geometrically is. Pass `refraction=none` for the geometric altitude. The difference is about half a degree at the horizon and negligible overhead.

**Large spans paginate.** With a fine `step` a long span can run to tens of thousands of samples; when `limit` is reached, `meta.sampling.nextCursor` carries the continuation.


# Events

Eclipses and apsides for the observer's location

Returns the events falling between two instants, as seen from the observer's location.

Two kinds are reported, told apart by `type`:

| `type`                           | What it is                                          | Bodies       |
| -------------------------------- | --------------------------------------------------- | ------------ |
| `lunar_eclipse`, `solar_eclipse` | The Earth's shadow on the Moon, or the Moon's on us | Sun and Moon |
| `apsis`                          | Nearest to, or farthest from, the Earth             | All          |

{% openapi src="/files/I36OyRpmo4rQOx2DuT1k" path="/events" method="get" %}
[astronomy-api-v3.yaml](https://1238588302-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKQ7_I-c79Ln1c6Chop-3789850253%2Fuploads%2Fgit-blob-c743ca2b9574a9aee2b1314404f74fd87c7a6cfc%2Fastronomy-api-v3.yaml?alt=media)
{% endopenapi %}

## Eclipses

Each contact carries the altitude of the body at that moment, so it is clear how much of the event actually happens above the horizon. A solar eclipse is reported as this observer sees it, so the same eclipse is total from one place and partial from another.

`totalStart` and `totalEnd` are null for an eclipse that does not reach totality where the observer stands.

## Apsides

A body's distance from the Earth rises and falls, and an apsis is a moment it turns around. They alternate: perigee, apogee, perigee, and so on.

For the Moon these are the familiar ones, about 13.8 days apart, and the reason some full Moons look larger than others.

For a planet the perigee is when it appears largest and brightest. It falls within a few days of opposition for the outer planets, and of inferior conjunction for Mercury and Venus. Jupiter's perigee on 6 December 2024 sat one day before its opposition; Saturn's on 8 September 2024 fell on the same day as its own.

The Sun's perigee is the Earth's perihelion, in early January, when the Earth is about 0.9833 AU from the Sun rather than the 1.0167 AU it reaches in July.

## Examples

Everything visible from London in 2026:

```
GET /api/v3/events?latitude=51.4779&longitude=-0.0015
    &from=2026-01-01&to=2026-12-31
```

Only eclipses:

```
GET /api/v3/events?types=lunar_eclipse,solar_eclipse
    &latitude=51.4779&longitude=-0.0015&from=2026-01-01&to=2026-12-31
```

When Mars is next closest, and how far away that is:

```
GET /api/v3/events?bodies=mars&types=apsis
    &latitude=51.4779&longitude=-0.0015&from=2024-06-01&to=2025-06-01
```

## Changes from v2

**Apsides are new.** v2 had no notion of them.

**Every body has events now.** v2 accepted only `sun` and `moon`, because eclipses were all it knew about.

**`type` and `kind` are separate.** v2 returned a single string such as `partial_lunar_eclipse`, which had to be split before either half could be used. v3 returns `type: "lunar_eclipse"` and `kind: "partial"`.

**The contact names are consistent.** v2 named the beginning and end of totality `fullStart` and `fullEnd` for a lunar eclipse but `totalStart` and `totalEnd` for a solar one, for the same idea. v3 uses `totalStart` and `totalEnd` throughout, and calls the block `contacts` rather than `eventHighlights`.


# Studio

Rendered images of the sky

The studio endpoints render an image and return a URL to it. Both take the same `observer` and `time`, and differ only in what they draw.

## What changed from v2

**`time` sits beside `observer`, not inside it.** v2 nested `date` within the observer object. A moment is not a property of a place, and every other endpoint treats them separately.

**Elevation is accepted.** v2's studio endpoints took only latitude and longitude and assumed sea level.

## ✨ Star Chart

{% openapi src="/files/I36OyRpmo4rQOx2DuT1k" path="/studio/star-chart" method="post" %}
[astronomy-api-v3.yaml](https://1238588302-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKQ7_I-c79Ln1c6Chop-3789850253%2Fuploads%2Fgit-blob-c743ca2b9574a9aee2b1314404f74fd87c7a6cfc%2Fastronomy-api-v3.yaml?alt=media)
{% endopenapi %}

A chart can be framed either on a point in the sky with a zoom level, or on a named constellation.

```json
{
    "observer": { "latitude": 51.4779, "longitude": -0.0015, "elevation": 0 },
    "time": "2024-06-21T22:00:00Z",
    "view": {
        "type": "area",
        "parameters": {
            "position": { "rightAscension": 5.5, "declination": -5.4 },
            "zoom": 4
        }
    },
    "style": "default"
}
```

v2 wrapped the position in a further `equatorial` object. There is only one frame involved, so v3 does not.

## 🌒 Moon Phase

{% openapi src="/files/I36OyRpmo4rQOx2DuT1k" path="/studio/moon-phase" method="post" %}
[astronomy-api-v3.yaml](https://1238588302-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKQ7_I-c79Ln1c6Chop-3789850253%2Fuploads%2Fgit-blob-c743ca2b9574a9aee2b1314404f74fd87c7a6cfc%2Fastronomy-api-v3.yaml?alt=media)
{% endopenapi %}

```json
{
    "observer": { "latitude": 51.4779, "longitude": -0.0015, "elevation": 0 },
    "time": "2024-06-21T22:00:00Z",
    "view": { "type": "portrait-simple", "orientation": "north-up" },
    "style": { "moonStyle": "default", "backgroundStyle": "stars" },
    "format": "png"
}
```

## Notes

**Images are cached.** An identical request returns the same URL without re-rendering.

**`format` accepts `png` or `svg`**, and defaults to `png`.


# Search

Find deep sky objects and stars

Searches the catalogue by name or by position.

Give `term` to search by name, or `rightAscension` and `declination` together to search by position. The two are mutually exclusive.

{% openapi src="/files/I36OyRpmo4rQOx2DuT1k" path="/search" method="get" %}
[astronomy-api-v3.yaml](https://1238588302-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKQ7_I-c79Ln1c6Chop-3789850253%2Fuploads%2Fgit-blob-c743ca2b9574a9aee2b1314404f74fd87c7a6cfc%2Fastronomy-api-v3.yaml?alt=media)
{% endopenapi %}

## Changes from v2

| v2                                         | v3                                        |
| ------------------------------------------ | ----------------------------------------- |
| `match_type`                               | `matchType`                               |
| `order_by`                                 | `orderBy`                                 |
| `ra`, `dec` (strings)                      | `rightAscension`, `declination` (numbers) |
| `limit`, `offset` declared as strings      | declared as integers                      |
| `position.equatorial.rightAscension.hours` | `rightAscension`                          |
| `position.equatorial.declination.degrees`  | `declination`                             |
| `*.string`                                 | `formatted.*`, with `include=formatted`   |

v2 declared `limit` and `offset` as strings because query parameters arrive as text. v3 declares the type it means and does the conversion itself.

## Examples

By name:

```
GET /api/v3/search?term=andromeda&matchType=fuzzy&limit=10
```

By position:

```
GET /api/v3/search?rightAscension=0.712&declination=41.269
```


# Migrating from v2

A field-by-field mapping from v2 to v3

v2 is unchanged and keeps working. Move when it suits you.

## Positions

### The request

| v2                         | v3                      | Notes                                                            |
| -------------------------- | ----------------------- | ---------------------------------------------------------------- |
| `/bodies/positions/{body}` | `?bodies=mars`          | A list, so several bodies need one request rather than several.  |
| `/bodies/positions`        | omit `bodies`           | v2 made "all bodies" the meaning of an absent path segment.      |
| `from_date`                | `from`                  | Now an instant, not only a date.                                 |
| `to_date`                  | `to`                    | Now an instant, not only a date.                                 |
| `time`                     | folded into `from`/`to` | v2 applied one time of day to every date.                        |
| —                          | `step`                  | New. ISO 8601 duration. Defaults to `P1D`, which is what v2 did. |
| —                          | `timezone`              | New. `auto` is v2's behaviour and the default.                   |
| `elevation` (required)     | `elevation` (optional)  | Defaults to sea level.                                           |
| `output=table\|rows`       | removed                 | One shape now. Laying it out is the client's job.                |
| —                          | `origin`                | New. `topocentric` or `geocentric`.                              |
| —                          | `refraction`            | New. `standard` or `none`.                                       |
| —                          | `include=formatted`     | New. Opt in to the sexagesimal strings v2 always sent.           |

Parameter names are camelCase throughout v3. v2 mixed `from_date` in the query string with `backgroundStyle` in JSON bodies.

### The response

| v2                                                       | v3                                                                    |
| -------------------------------------------------------- | --------------------------------------------------------------------- |
| `data.table.rows[].cells[]` or `data.rows[].positions[]` | `data[].samples[]`                                                    |
| `cell.date`                                              | `sample.time`                                                         |
| `position.equatorial.rightAscension.hours` (string)      | `sample.rightAscension` (number)                                      |
| `position.equatorial.declination.degrees` (string)       | `sample.declination` (number)                                         |
| `position.horizontal.altitude.degrees` (string)          | `sample.altitude` (number)                                            |
| `position.horizontal.azimuth.degrees` (string)           | `sample.azimuth` (number)                                             |
| `position.horizonal.*`                                   | removed — it was a misspelling of `horizontal` and duplicated it      |
| `*.string`                                               | `sample.formatted.*`, only with `include=formatted`                   |
| `distance.fromEarth.au` (string)                         | `sample.distance.au` (number)                                         |
| `distance.fromEarth.km` (string)                         | `sample.distance.km` (number)                                         |
| `position.constellation.id`                              | removed — a lowercase copy of the abbreviation                        |
| `position.constellation.short`                           | `sample.constellation.abbreviation`                                   |
| `position.constellation.name`                            | `sample.constellation.name`                                           |
| `extraInfo.elongation`                                   | `sample.elongation`                                                   |
| `extraInfo.magnitude`                                    | `sample.magnitude`                                                    |
| `extraInfo.phase.angel`                                  | `sample.phase.angle` — spelling corrected                             |
| `extraInfo.phase.fraction`                               | `sample.phase.fraction` — **value corrected**, see below              |
| `extraInfo.phase.string`                                 | `sample.phase.name`                                                   |
| `cell.id` / `cell.name`                                  | `data[].body.id` / `.name`, once per body rather than on every sample |

### Two corrections

**`phase.angel` → `phase.angle`.** A misspelling in v2 that reached the wire.

**`phase.fraction` was wrong.** v2 reported a value between 0 and 0.067, and it ran backwards: largest at new moon, zero at full. v3 reports the fraction of the Moon's disc that is lit, 0 at new and 1 at full. Anything that compensated for the old behaviour needs unwinding.

### Precision

v2 rounded angles to two decimal places, which is 36 arcseconds — far coarser than the underlying calculation. v3 returns five decimal places, about 0.04 arcseconds. Parsers that assumed a fixed width need to stop assuming it.

### Errors

| v2                                                           | v3                                        |
| ------------------------------------------------------------ | ----------------------------------------- |
| `{ "errors": [ { "property": "instance.latitude", ... } ] }` | RFC 9457 problem details                  |
| 422 for every validation failure                             | 400 for unparseable, 422 for unacceptable |
| No stable code                                               | `type` URI and a per-parameter `code`     |

## Events

### The request

| v2                             | v3                                    |
| ------------------------------ | ------------------------------------- |
| `/bodies/events/{body}`        | `/events?bodies=moon`                 |
| `from_date`, `to_date`, `time` | `from`, `to`                          |
| only `sun` and `moon` accepted | any body                              |
| —                              | `types`, to pick which kinds of event |

### The response

| v2                                  | v3                                            |
| ----------------------------------- | --------------------------------------------- |
| `data.table.rows[].cells[]`         | `data[].events[]`                             |
| `type: "partial_lunar_eclipse"`     | `type: "lunar_eclipse"` and `kind: "partial"` |
| `eventHighlights`                   | `contacts`                                    |
| `eventHighlights.fullStart` (lunar) | `contacts.totalStart`                         |
| `eventHighlights.fullEnd` (lunar)   | `contacts.totalEnd`                           |
| `eventHighlights.*.date`            | `contacts.*.time`                             |
| `extraInfo.obscuration`             | `obscuration`                                 |

v2 named the same two moments `fullStart`/`fullEnd` for lunar eclipses and `totalStart`/`totalEnd` for solar ones. v3 uses the `total` names for both.

### Apsides are new

v3 adds `type: "apsis"`, the moments a body is nearest to or farthest from the Earth. Every body has them and they alternate, so a response may now contain events with no `contacts` and no `obscuration`, carrying a `distance` instead.

Anything that assumed every event was an eclipse should branch on `type`, or pass `types=lunar_eclipse,solar_eclipse` to ask for what v2 used to return.

## Search

| v2                                         | v3                                        |
| ------------------------------------------ | ----------------------------------------- |
| `match_type`                               | `matchType`                               |
| `order_by`                                 | `orderBy`                                 |
| `ra`, `dec` (strings)                      | `rightAscension`, `declination` (numbers) |
| `limit`, `offset` (declared as strings)    | declared as integers                      |
| `position.equatorial.rightAscension.hours` | `rightAscension`                          |
| `position.equatorial.declination.degrees`  | `declination`                             |

## Studio

| v2                                                   | v3                                        |
| ---------------------------------------------------- | ----------------------------------------- |
| `observer.date`                                      | `time`, beside `observer`                 |
| observer had no `elevation`                          | `observer.elevation`, optional            |
| `view.parameters.position.equatorial.rightAscension` | `view.parameters.position.rightAscension` |

The response is unchanged: `{ "data": { "imageUrl": "..." } }`.

## Bodies

**`GET /bodies` is gone.** It returned a fixed list of ten identifiers that never change. That list is in the specification, so `bodies` is an enumerated type in generated clients and there is nothing to fetch. Anything that called `/bodies` to populate a picker can hold the list directly.

**`earth` is no longer among them.** Seen from the Earth it is at zero distance and has no direction, so the numbers v2 returned for it were arbitrary. Requesting it from `/positions` returns 422.


# Bodies

Get celestial body information for the given latitude, longitude and date/time.

Bodies API could be used to get information about the planets, the sun and the moon. Most endpoints are GET requests and will require you to submit [Observer Parameters](/requests-and-response/observer-parameters) as query parameters.


# Positions

Celestial body positions API

Positions API can return position for a single body or all available bodies. This is useful if you don't want to make multiple requests for each body, and don't want to get throttled by the API request limitations.

See [Body Properties](/requests-and-response/body-properties) for the available properties of bodies.

## Get all bodies positions

<mark style="color:blue;">`GET`</mark> `https://api.astronomyapi.com/api/v2/bodies/positions`

Returns an iterable list of bodies and their properties in tabular format.

#### Query Parameters

| Name                                         | Type   | Description                                                                                                                 |
| -------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------- |
| latitude<mark style="color:red;">\*</mark>   | string | Latitude of the observer's location                                                                                         |
| longitude<mark style="color:red;">\*</mark>  | string | Longitude of the observer's location                                                                                        |
| elevation<mark style="color:red;">\*</mark>  | string | Elevation from the sea in Meters                                                                                            |
| from\_date<mark style="color:red;">\*</mark> | string | Starting date as Date. The maximum number of days you can query is 366 days.                                                |
| to\_date<mark style="color:red;">\*</mark>   | string | Ending date as Date. The maximum number of days you can query is 366 days.                                                  |
| time<mark style="color:red;">\*</mark>       | string | Observer's time as Time                                                                                                     |
| output                                       | string | <p>Output format.</p><p><code>rows</code></p><p>or</p><p><code>table</code></p><p>. Default is</p><p><code>table</code></p> |

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | string | Basic       |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "data": {
        "dates": {
            "from": "2020-12-20T09:00:00.000-05:00",
            "to": "2020-12-23T09:00:00.000-05:00"
        },
        "observer": {
            "location": {
                "longitude": -84.39733,
                "latitude": 38.775867,
                "elevation": 0
            }
        },
        "table": {
            "header": [
                "2020-12-20T09:00:00.000-05:00",
                "2020-12-21T09:00:00.000-05:00",
                "2020-12-22T09:00:00.000-05:00",
                "2020-12-23T09:00:00.000-05:00"
            ],
            "rows": [
                {
                    "entry": {
                        "id": "sun",
                        "name": "Sun"
                    },
                    "cells": [
                        {
                            "date": "2020-12-20T09:00:00.000-05:00",
                            "id": "sun",
                            "name": "Sun",
                            "distance": {
                                "fromEarth": {
                                    "au": "0.98378",
                                    "km": "147171382.76144"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "10.04",
                                        "string": "10° 2' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "131.21",
                                        "string": "131° 12' 36\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "10.04",
                                        "string": "10° 2' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "131.21",
                                        "string": "131° 12' 36\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "17.92",
                                        "string": "17h 55m 12s"
                                    },
                                    "declination": {
                                        "degrees": "-23.43",
                                        "string": "-24° 34' 12\""
                                    }
                                },
                                "constellation": {
                                    "id": "sgr",
                                    "short": "Sgr",
                                    "name": "Sagittarius"
                                }
                            },
                            "extraInfo": {
                                "elongation": 0,
                                "magnitude": -26.77762
                            }
                        },
                        {
                            "date": "2020-12-21T09:00:00.000-05:00",
                            "id": "sun",
                            "name": "Sun",
                            "distance": {
                                "fromEarth": {
                                    "au": "0.98371",
                                    "km": "147160312.87067"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "9.96",
                                        "string": "9° 57' 36\""
                                    },
                                    "azimuth": {
                                        "degrees": "131.13",
                                        "string": "131° 7' 48\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "9.96",
                                        "string": "9° 57' 36\""
                                    },
                                    "azimuth": {
                                        "degrees": "131.13",
                                        "string": "131° 7' 48\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "17.99",
                                        "string": "17h 59m 23s"
                                    },
                                    "declination": {
                                        "degrees": "-23.44",
                                        "string": "-24° 33' 36\""
                                    }
                                },
                                "constellation": {
                                    "id": "sgr",
                                    "short": "Sgr",
                                    "name": "Sagittarius"
                                }
                            },
                            "extraInfo": {
                                "elongation": 0,
                                "magnitude": -26.77778
                            }
                        },
                        {
                            "date": "2020-12-22T09:00:00.000-05:00",
                            "id": "sun",
                            "name": "Sun",
                            "distance": {
                                "fromEarth": {
                                    "au": "0.98364",
                                    "km": "147149972.87077"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "9.90",
                                        "string": "9° 54' 0\""
                                    },
                                    "azimuth": {
                                        "degrees": "131.03",
                                        "string": "131° 1' 48\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "9.90",
                                        "string": "9° 54' 0\""
                                    },
                                    "azimuth": {
                                        "degrees": "131.03",
                                        "string": "131° 1' 48\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "18.07",
                                        "string": "18h 04m 12s"
                                    },
                                    "declination": {
                                        "degrees": "-23.44",
                                        "string": "-24° 33' 36\""
                                    }
                                },
                                "constellation": {
                                    "id": "sgr",
                                    "short": "Sgr",
                                    "name": "Sagittarius"
                                }
                            },
                            "extraInfo": {
                                "elongation": 0,
                                "magnitude": -26.77794
                            }
                        },
                        {
                            "date": "2020-12-23T09:00:00.000-05:00",
                            "id": "sun",
                            "name": "Sun",
                            "distance": {
                                "fromEarth": {
                                    "au": "0.98357",
                                    "km": "147140401.77424"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "9.83",
                                        "string": "9° 49' 48\""
                                    },
                                    "azimuth": {
                                        "degrees": "130.94",
                                        "string": "130° 56' 24\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "9.83",
                                        "string": "9° 49' 48\""
                                    },
                                    "azimuth": {
                                        "degrees": "130.94",
                                        "string": "130° 56' 24\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "18.14",
                                        "string": "18h 08m 24s"
                                    },
                                    "declination": {
                                        "degrees": "-23.42",
                                        "string": "-24° 34' 48\""
                                    }
                                },
                                "constellation": {
                                    "id": "sgr",
                                    "short": "Sgr",
                                    "name": "Sagittarius"
                                }
                            },
                            "extraInfo": {
                                "elongation": 0,
                                "magnitude": -26.77808
                            }
                        }
                    ]
                },
                {
                    "entry": {
                        "id": "moon",
                        "name": "Moon"
                    },
                    "cells": [
                        {
                            "date": "2020-12-20T09:00:00.000-05:00",
                            "id": "moon",
                            "name": "Moon",
                            "distance": {
                                "fromEarth": {
                                    "au": "0.00267",
                                    "km": "398770.33841"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-39.40",
                                        "string": "-40° 36' 0\""
                                    },
                                    "azimuth": {
                                        "degrees": "70.99",
                                        "string": "70° 59' 24\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-39.40",
                                        "string": "-40° 36' 0\""
                                    },
                                    "azimuth": {
                                        "degrees": "70.99",
                                        "string": "70° 59' 24\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "23.13",
                                        "string": "23h 07m 48s"
                                    },
                                    "declination": {
                                        "degrees": "-11.96",
                                        "string": "-12° 2' 24\""
                                    }
                                },
                                "constellation": {
                                    "id": "aqr",
                                    "short": "Aqr",
                                    "name": "Aquarius"
                                }
                            },
                            "extraInfo": {
                                "elongation": 74.27557,
                                "magnitude": -9.45722,
                                "phase": {
                                    "angel": "74.2018",
                                    "fraction": "0.042",
                                    "string": "Waxing Crescent"
                                }
                            }
                        },
                        {
                            "date": "2020-12-21T09:00:00.000-05:00",
                            "id": "moon",
                            "name": "Moon",
                            "distance": {
                                "fromEarth": {
                                    "au": "0.00270",
                                    "km": "403433.20005"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-43.26",
                                        "string": "-44° 44' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "56.79",
                                        "string": "56° 47' 24\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-43.26",
                                        "string": "-44° 44' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "56.79",
                                        "string": "56° 47' 24\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "23.89",
                                        "string": "23h 53m 24s"
                                    },
                                    "declination": {
                                        "degrees": "-7.15",
                                        "string": "-8° 51' 0\""
                                    }
                                },
                                "constellation": {
                                    "id": "aqr",
                                    "short": "Aqr",
                                    "name": "Aquarius"
                                }
                            },
                            "extraInfo": {
                                "elongation": 85.52956,
                                "magnitude": -9.90583,
                                "phase": {
                                    "angel": "85.5048",
                                    "fraction": "0.036",
                                    "string": "Waxing Crescent"
                                }
                            }
                        },
                        {
                            "date": "2020-12-22T09:00:00.000-05:00",
                            "id": "moon",
                            "name": "Moon",
                            "distance": {
                                "fromEarth": {
                                    "au": "0.00272",
                                    "km": "406803.88243"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-45.10",
                                        "string": "-46° 54' 0\""
                                    },
                                    "azimuth": {
                                        "degrees": "41.52",
                                        "string": "41° 31' 12\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-45.10",
                                        "string": "-46° 54' 0\""
                                    },
                                    "azimuth": {
                                        "degrees": "41.52",
                                        "string": "41° 31' 12\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "0.61",
                                        "string": "00h 36m 36s"
                                    },
                                    "declination": {
                                        "degrees": "-2.20",
                                        "string": "-3° 48' 0\""
                                    }
                                },
                                "constellation": {
                                    "id": "cet",
                                    "short": "Cet",
                                    "name": "Cetus"
                                }
                            },
                            "extraInfo": {
                                "elongation": 96.54755,
                                "magnitude": -10.29789,
                                "phase": {
                                    "angel": "96.5672",
                                    "fraction": "0.030",
                                    "string": "Waxing Gibbous"
                                }
                            }
                        },
                        {
                            "date": "2020-12-23T09:00:00.000-05:00",
                            "id": "moon",
                            "name": "Moon",
                            "distance": {
                                "fromEarth": {
                                    "au": "0.00273",
                                    "km": "408768.63964"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-44.84",
                                        "string": "-45° 9' 36\""
                                    },
                                    "azimuth": {
                                        "degrees": "26.04",
                                        "string": "26° 2' 24\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-44.84",
                                        "string": "-45° 9' 36\""
                                    },
                                    "azimuth": {
                                        "degrees": "26.04",
                                        "string": "26° 2' 24\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "1.32",
                                        "string": "01h 19m 12s"
                                    },
                                    "declination": {
                                        "degrees": "2.74",
                                        "string": "2° 44' 24\""
                                    }
                                },
                                "constellation": {
                                    "id": "psc",
                                    "short": "Psc",
                                    "name": "Pisces"
                                }
                            },
                            "extraInfo": {
                                "elongation": 107.41558,
                                "magnitude": -10.65118,
                                "phase": {
                                    "angel": "107.4676",
                                    "fraction": "0.023",
                                    "string": "Waxing Gibbous"
                                }
                            }
                        }
                    ]
                },
                {
                    "entry": {
                        "id": "mercury",
                        "name": "Mercury"
                    },
                    "cells": [
                        {
                            "date": "2020-12-20T09:00:00.000-05:00",
                            "id": "mercury",
                            "name": "Mercury",
                            "distance": {
                                "fromEarth": {
                                    "au": "1.44663",
                                    "km": "216412357.18070"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "8.75",
                                        "string": "8° 45' 0\""
                                    },
                                    "azimuth": {
                                        "degrees": "131.99",
                                        "string": "131° 59' 24\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "8.75",
                                        "string": "8° 45' 0\""
                                    },
                                    "azimuth": {
                                        "degrees": "131.99",
                                        "string": "131° 59' 24\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "17.93",
                                        "string": "17h 55m 48s"
                                    },
                                    "declination": {
                                        "degrees": "-24.92",
                                        "string": "-25° 4' 48\""
                                    }
                                },
                                "constellation": {
                                    "id": "sgr",
                                    "short": "Sgr",
                                    "name": "Sagittarius"
                                }
                            },
                            "extraInfo": {
                                "elongation": 1.50745,
                                "magnitude": -1.31155
                            }
                        },
                        {
                            "date": "2020-12-21T09:00:00.000-05:00",
                            "id": "mercury",
                            "name": "Mercury",
                            "distance": {
                                "fromEarth": {
                                    "au": "1.44477",
                                    "km": "216134837.46619"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "8.26",
                                        "string": "8° 15' 36\""
                                    },
                                    "azimuth": {
                                        "degrees": "131.50",
                                        "string": "131° 30' 0\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "8.26",
                                        "string": "8° 15' 36\""
                                    },
                                    "azimuth": {
                                        "degrees": "131.50",
                                        "string": "131° 30' 0\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "18.05",
                                        "string": "18h 03m 00s"
                                    },
                                    "declination": {
                                        "degrees": "-25.00",
                                        "string": "-25° 0' 0\""
                                    }
                                },
                                "constellation": {
                                    "id": "sgr",
                                    "short": "Sgr",
                                    "name": "Sagittarius"
                                }
                            },
                            "extraInfo": {
                                "elongation": 1.76363,
                                "magnitude": -1.29482
                            }
                        },
                        {
                            "date": "2020-12-22T09:00:00.000-05:00",
                            "id": "mercury",
                            "name": "Mercury",
                            "distance": {
                                "fromEarth": {
                                    "au": "1.44234",
                                    "km": "215771107.43777"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "7.78",
                                        "string": "7° 46' 48\""
                                    },
                                    "azimuth": {
                                        "degrees": "131.00",
                                        "string": "131° 0' 0\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "7.78",
                                        "string": "7° 46' 48\""
                                    },
                                    "azimuth": {
                                        "degrees": "131.00",
                                        "string": "131° 0' 0\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "18.17",
                                        "string": "18h 10m 12s"
                                    },
                                    "declination": {
                                        "degrees": "-25.06",
                                        "string": "-26° 56' 24\""
                                    }
                                },
                                "constellation": {
                                    "id": "sgr",
                                    "short": "Sgr",
                                    "name": "Sagittarius"
                                }
                            },
                            "extraInfo": {
                                "elongation": 2.14413,
                                "magnitude": -1.26822
                            }
                        },
                        {
                            "date": "2020-12-23T09:00:00.000-05:00",
                            "id": "mercury",
                            "name": "Mercury",
                            "distance": {
                                "fromEarth": {
                                    "au": "1.43933",
                                    "km": "215320384.16055"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "7.30",
                                        "string": "7° 18' 0\""
                                    },
                                    "azimuth": {
                                        "degrees": "130.49",
                                        "string": "130° 29' 24\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "7.30",
                                        "string": "7° 18' 0\""
                                    },
                                    "azimuth": {
                                        "degrees": "130.49",
                                        "string": "130° 29' 24\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "18.29",
                                        "string": "18h 17m 24s"
                                    },
                                    "declination": {
                                        "degrees": "-25.09",
                                        "string": "-26° 54' 36\""
                                    }
                                },
                                "constellation": {
                                    "id": "sgr",
                                    "short": "Sgr",
                                    "name": "Sagittarius"
                                }
                            },
                            "extraInfo": {
                                "elongation": 2.59661,
                                "magnitude": -1.23712
                            }
                        }
                    ]
                },
                {
                    "entry": {
                        "id": "venus",
                        "name": "Venus"
                    },
                    "cells": [
                        {
                            "date": "2020-12-20T09:00:00.000-05:00",
                            "id": "venus",
                            "name": "Venus",
                            "distance": {
                                "fromEarth": {
                                    "au": "1.51668",
                                    "km": "226892479.91564"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "24.97",
                                        "string": "24° 58' 12\""
                                    },
                                    "azimuth": {
                                        "degrees": "149.65",
                                        "string": "149° 39' 0\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "24.97",
                                        "string": "24° 58' 12\""
                                    },
                                    "azimuth": {
                                        "degrees": "149.65",
                                        "string": "149° 39' 0\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "16.28",
                                        "string": "16h 16m 48s"
                                    },
                                    "declination": {
                                        "degrees": "-20.19",
                                        "string": "-21° 48' 36\""
                                    }
                                },
                                "constellation": {
                                    "id": "sco",
                                    "short": "Sco",
                                    "name": "Scorpius"
                                }
                            },
                            "extraInfo": {
                                "elongation": 23.0487,
                                "magnitude": -3.87581
                            }
                        },
                        {
                            "date": "2020-12-21T09:00:00.000-05:00",
                            "id": "venus",
                            "name": "Venus",
                            "distance": {
                                "fromEarth": {
                                    "au": "1.52066",
                                    "km": "227487606.29970"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "24.62",
                                        "string": "24° 37' 12\""
                                    },
                                    "azimuth": {
                                        "degrees": "149.46",
                                        "string": "149° 27' 36\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "24.62",
                                        "string": "24° 37' 12\""
                                    },
                                    "azimuth": {
                                        "degrees": "149.46",
                                        "string": "149° 27' 36\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "16.36",
                                        "string": "16h 21m 36s"
                                    },
                                    "declination": {
                                        "degrees": "-20.44",
                                        "string": "-21° 33' 36\""
                                    }
                                },
                                "constellation": {
                                    "id": "sco",
                                    "short": "Sco",
                                    "name": "Scorpius"
                                }
                            },
                            "extraInfo": {
                                "elongation": 22.81549,
                                "magnitude": -3.8748
                            }
                        },
                        {
                            "date": "2020-12-22T09:00:00.000-05:00",
                            "id": "venus",
                            "name": "Venus",
                            "distance": {
                                "fromEarth": {
                                    "au": "1.52460",
                                    "km": "228077053.65050"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "24.28",
                                        "string": "24° 16' 48\""
                                    },
                                    "azimuth": {
                                        "degrees": "149.26",
                                        "string": "149° 15' 36\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "24.28",
                                        "string": "24° 16' 48\""
                                    },
                                    "azimuth": {
                                        "degrees": "149.26",
                                        "string": "149° 15' 36\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "16.45",
                                        "string": "16h 27m 00s"
                                    },
                                    "declination": {
                                        "degrees": "-20.68",
                                        "string": "-21° 19' 12\""
                                    }
                                },
                                "constellation": {
                                    "id": "oph",
                                    "short": "Oph",
                                    "name": "Ophiuchus"
                                }
                            },
                            "extraInfo": {
                                "elongation": 22.58214,
                                "magnitude": -3.87383
                            }
                        },
                        {
                            "date": "2020-12-23T09:00:00.000-05:00",
                            "id": "venus",
                            "name": "Venus",
                            "distance": {
                                "fromEarth": {
                                    "au": "1.52850",
                                    "km": "228660857.21992"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "23.94",
                                        "string": "23° 56' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "149.06",
                                        "string": "149° 3' 36\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "23.94",
                                        "string": "23° 56' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "149.06",
                                        "string": "149° 3' 36\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "16.54",
                                        "string": "16h 32m 24s"
                                    },
                                    "declination": {
                                        "degrees": "-20.91",
                                        "string": "-21° 5' 24\""
                                    }
                                },
                                "constellation": {
                                    "id": "oph",
                                    "short": "Oph",
                                    "name": "Ophiuchus"
                                }
                            },
                            "extraInfo": {
                                "elongation": 22.34865,
                                "magnitude": -3.87289
                            }
                        }
                    ]
                },
                {
                    "entry": {
                        "id": "earth",
                        "name": "Earth"
                    },
                    "cells": [
                        {
                            "date": "2020-12-20T09:00:00.000-05:00",
                            "id": "earth",
                            "name": "Earth",
                            "distance": {
                                "fromEarth": {
                                    "au": "0.00004",
                                    "km": "6369.79183"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-89.81",
                                        "string": "-90° 11' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "360.00",
                                        "string": "360° 0' 0\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-89.81",
                                        "string": "-90° 11' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "360.00",
                                        "string": "360° 0' 0\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "2.33",
                                        "string": "02h 19m 48s"
                                    },
                                    "declination": {
                                        "degrees": "-38.68",
                                        "string": "-39° 19' 12\""
                                    }
                                },
                                "constellation": {
                                    "id": "for",
                                    "short": "For",
                                    "name": "Fornax"
                                }
                            },
                            "extraInfo": {
                                "elongation": null,
                                "magnitude": null
                            }
                        },
                        {
                            "date": "2020-12-21T09:00:00.000-05:00",
                            "id": "earth",
                            "name": "Earth",
                            "distance": {
                                "fromEarth": {
                                    "au": "0.00004",
                                    "km": "6369.79183"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-89.81",
                                        "string": "-90° 11' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "0.00",
                                        "string": "0° 0' 0\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-89.81",
                                        "string": "-90° 11' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "0.00",
                                        "string": "0° 0' 0\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "2.40",
                                        "string": "02h 24m 00s"
                                    },
                                    "declination": {
                                        "degrees": "-38.68",
                                        "string": "-39° 19' 12\""
                                    }
                                },
                                "constellation": {
                                    "id": "for",
                                    "short": "For",
                                    "name": "Fornax"
                                }
                            },
                            "extraInfo": {
                                "elongation": null,
                                "magnitude": null
                            }
                        },
                        {
                            "date": "2020-12-22T09:00:00.000-05:00",
                            "id": "earth",
                            "name": "Earth",
                            "distance": {
                                "fromEarth": {
                                    "au": "0.00004",
                                    "km": "6369.79183"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-89.81",
                                        "string": "-90° 11' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "0.00",
                                        "string": "0° 0' 0\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-89.81",
                                        "string": "-90° 11' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "0.00",
                                        "string": "0° 0' 0\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "2.47",
                                        "string": "02h 28m 12s"
                                    },
                                    "declination": {
                                        "degrees": "-38.68",
                                        "string": "-39° 19' 12\""
                                    }
                                },
                                "constellation": {
                                    "id": "for",
                                    "short": "For",
                                    "name": "Fornax"
                                }
                            },
                            "extraInfo": {
                                "elongation": null,
                                "magnitude": null
                            }
                        },
                        {
                            "date": "2020-12-23T09:00:00.000-05:00",
                            "id": "earth",
                            "name": "Earth",
                            "distance": {
                                "fromEarth": {
                                    "au": "0.00004",
                                    "km": "6369.79183"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-89.81",
                                        "string": "-90° 11' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "0.00",
                                        "string": "0° 0' 0\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-89.81",
                                        "string": "-90° 11' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "0.00",
                                        "string": "0° 0' 0\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "2.53",
                                        "string": "02h 31m 48s"
                                    },
                                    "declination": {
                                        "degrees": "-38.68",
                                        "string": "-39° 19' 12\""
                                    }
                                },
                                "constellation": {
                                    "id": "for",
                                    "short": "For",
                                    "name": "Fornax"
                                }
                            },
                            "extraInfo": {
                                "elongation": null,
                                "magnitude": null
                            }
                        }
                    ]
                },
                {
                    "entry": {
                        "id": "mars",
                        "name": "Mars"
                    },
                    "cells": [
                        {
                            "date": "2020-12-20T09:00:00.000-05:00",
                            "id": "mars",
                            "name": "Mars",
                            "distance": {
                                "fromEarth": {
                                    "au": "0.79790",
                                    "km": "119363666.52216"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-39.61",
                                        "string": "-40° 23' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "18.64",
                                        "string": "18° 38' 24\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-39.61",
                                        "string": "-40° 23' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "18.64",
                                        "string": "18° 38' 24\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "1.37",
                                        "string": "01h 22m 12s"
                                    },
                                    "declination": {
                                        "degrees": "9.31",
                                        "string": "9° 18' 36\""
                                    }
                                },
                                "constellation": {
                                    "id": "psc",
                                    "short": "Psc",
                                    "name": "Pisces"
                                }
                            },
                            "extraInfo": {
                                "elongation": 113.62223,
                                "magnitude": -0.54426
                            }
                        },
                        {
                            "date": "2020-12-21T09:00:00.000-05:00",
                            "id": "mars",
                            "name": "Mars",
                            "distance": {
                                "fromEarth": {
                                    "au": "0.80648",
                                    "km": "120648034.74665"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-39.29",
                                        "string": "-40° 42' 36\""
                                    },
                                    "azimuth": {
                                        "degrees": "19.39",
                                        "string": "19° 23' 24\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-39.29",
                                        "string": "-40° 42' 36\""
                                    },
                                    "azimuth": {
                                        "degrees": "19.39",
                                        "string": "19° 23' 24\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "1.39",
                                        "string": "01h 23m 24s"
                                    },
                                    "declination": {
                                        "degrees": "9.48",
                                        "string": "9° 28' 48\""
                                    }
                                },
                                "constellation": {
                                    "id": "psc",
                                    "short": "Psc",
                                    "name": "Pisces"
                                }
                            },
                            "extraInfo": {
                                "elongation": 112.97481,
                                "magnitude": -0.5164
                            }
                        },
                        {
                            "date": "2020-12-22T09:00:00.000-05:00",
                            "id": "mars",
                            "name": "Mars",
                            "distance": {
                                "fromEarth": {
                                    "au": "0.81512",
                                    "km": "121939469.90072"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-38.96",
                                        "string": "-39° 2' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "20.12",
                                        "string": "20° 7' 12\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-38.96",
                                        "string": "-39° 2' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "20.12",
                                        "string": "20° 7' 12\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "1.42",
                                        "string": "01h 25m 12s"
                                    },
                                    "declination": {
                                        "degrees": "9.64",
                                        "string": "9° 38' 24\""
                                    }
                                },
                                "constellation": {
                                    "id": "psc",
                                    "short": "Psc",
                                    "name": "Pisces"
                                }
                            },
                            "extraInfo": {
                                "elongation": 112.33371,
                                "magnitude": -0.48879
                            }
                        },
                        {
                            "date": "2020-12-23T09:00:00.000-05:00",
                            "id": "mars",
                            "name": "Mars",
                            "distance": {
                                "fromEarth": {
                                    "au": "0.82379",
                                    "km": "123237773.30768"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-38.63",
                                        "string": "-39° 22' 12\""
                                    },
                                    "azimuth": {
                                        "degrees": "20.84",
                                        "string": "20° 50' 24\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-38.63",
                                        "string": "-39° 22' 12\""
                                    },
                                    "azimuth": {
                                        "degrees": "20.84",
                                        "string": "20° 50' 24\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "1.44",
                                        "string": "01h 26m 24s"
                                    },
                                    "declination": {
                                        "degrees": "9.80",
                                        "string": "9° 48' 0\""
                                    }
                                },
                                "constellation": {
                                    "id": "psc",
                                    "short": "Psc",
                                    "name": "Pisces"
                                }
                            },
                            "extraInfo": {
                                "elongation": 111.69878,
                                "magnitude": -0.4614
                            }
                        }
                    ]
                },
                {
                    "entry": {
                        "id": "jupiter",
                        "name": "Jupiter"
                    },
                    "cells": [
                        {
                            "date": "2020-12-20T09:00:00.000-05:00",
                            "id": "jupiter",
                            "name": "Jupiter",
                            "distance": {
                                "fromEarth": {
                                    "au": "5.91663",
                                    "km": "885114784.19947"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-10.13",
                                        "string": "-11° 52' 12\""
                                    },
                                    "azimuth": {
                                        "degrees": "107.86",
                                        "string": "107° 51' 36\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-10.13",
                                        "string": "-11° 52' 12\""
                                    },
                                    "azimuth": {
                                        "degrees": "107.86",
                                        "string": "107° 51' 36\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "20.15",
                                        "string": "20h 09m 00s"
                                    },
                                    "declination": {
                                        "degrees": "-20.63",
                                        "string": "-21° 22' 12\""
                                    }
                                },
                                "constellation": {
                                    "id": "cap",
                                    "short": "Cap",
                                    "name": "Capricornus"
                                }
                            },
                            "extraInfo": {
                                "elongation": 31.08024,
                                "magnitude": -1.97323
                            }
                        },
                        {
                            "date": "2020-12-21T09:00:00.000-05:00",
                            "id": "jupiter",
                            "name": "Jupiter",
                            "distance": {
                                "fromEarth": {
                                    "au": "5.92439",
                                    "km": "886276755.73005"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-9.54",
                                        "string": "-10° 27' 36\""
                                    },
                                    "azimuth": {
                                        "degrees": "108.27",
                                        "string": "108° 16' 12\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-9.54",
                                        "string": "-10° 27' 36\""
                                    },
                                    "azimuth": {
                                        "degrees": "108.27",
                                        "string": "108° 16' 12\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "20.16",
                                        "string": "20h 09m 36s"
                                    },
                                    "declination": {
                                        "degrees": "-20.58",
                                        "string": "-21° 25' 12\""
                                    }
                                },
                                "constellation": {
                                    "id": "cap",
                                    "short": "Cap",
                                    "name": "Capricornus"
                                }
                            },
                            "extraInfo": {
                                "elongation": 30.2815,
                                "magnitude": -1.9712
                            }
                        },
                        {
                            "date": "2020-12-22T09:00:00.000-05:00",
                            "id": "jupiter",
                            "name": "Jupiter",
                            "distance": {
                                "fromEarth": {
                                    "au": "5.93197",
                                    "km": "887410474.10824"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-8.95",
                                        "string": "-9° 3' 0\""
                                    },
                                    "azimuth": {
                                        "degrees": "108.67",
                                        "string": "108° 40' 12\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-8.95",
                                        "string": "-9° 3' 0\""
                                    },
                                    "azimuth": {
                                        "degrees": "108.67",
                                        "string": "108° 40' 12\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "20.18",
                                        "string": "20h 10m 48s"
                                    },
                                    "declination": {
                                        "degrees": "-20.54",
                                        "string": "-21° 27' 36\""
                                    }
                                },
                                "constellation": {
                                    "id": "cap",
                                    "short": "Cap",
                                    "name": "Capricornus"
                                }
                            },
                            "extraInfo": {
                                "elongation": 29.48361,
                                "magnitude": -1.96924
                            }
                        },
                        {
                            "date": "2020-12-23T09:00:00.000-05:00",
                            "id": "jupiter",
                            "name": "Jupiter",
                            "distance": {
                                "fromEarth": {
                                    "au": "5.93936",
                                    "km": "888515777.34535"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-8.36",
                                        "string": "-9° 38' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "109.07",
                                        "string": "109° 4' 12\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-8.36",
                                        "string": "-9° 38' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "109.07",
                                        "string": "109° 4' 12\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "20.19",
                                        "string": "20h 11m 24s"
                                    },
                                    "declination": {
                                        "degrees": "-20.49",
                                        "string": "-21° 30' 36\""
                                    }
                                },
                                "constellation": {
                                    "id": "cap",
                                    "short": "Cap",
                                    "name": "Capricornus"
                                }
                            },
                            "extraInfo": {
                                "elongation": 28.68655,
                                "magnitude": -1.96736
                            }
                        }
                    ]
                },
                {
                    "entry": {
                        "id": "saturn",
                        "name": "Saturn"
                    },
                    "cells": [
                        {
                            "date": "2020-12-20T09:00:00.000-05:00",
                            "id": "saturn",
                            "name": "Saturn",
                            "distance": {
                                "fromEarth": {
                                    "au": "10.81706",
                                    "km": "1618209125.72204"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-10.14",
                                        "string": "-11° 51' 36\""
                                    },
                                    "azimuth": {
                                        "degrees": "107.69",
                                        "string": "107° 41' 24\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-10.14",
                                        "string": "-11° 51' 36\""
                                    },
                                    "azimuth": {
                                        "degrees": "107.69",
                                        "string": "107° 41' 24\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "20.16",
                                        "string": "20h 09m 36s"
                                    },
                                    "declination": {
                                        "degrees": "-20.50",
                                        "string": "-21° 30' 0\""
                                    }
                                },
                                "constellation": {
                                    "id": "cap",
                                    "short": "Cap",
                                    "name": "Capricornus"
                                }
                            },
                            "extraInfo": {
                                "elongation": 31.21146,
                                "magnitude": 0.511
                            }
                        },
                        {
                            "date": "2020-12-21T09:00:00.000-05:00",
                            "id": "saturn",
                            "name": "Saturn",
                            "distance": {
                                "fromEarth": {
                                    "au": "10.82553",
                                    "km": "1619475828.82418"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-9.47",
                                        "string": "-10° 31' 48\""
                                    },
                                    "azimuth": {
                                        "degrees": "108.19",
                                        "string": "108° 11' 24\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-9.47",
                                        "string": "-10° 31' 48\""
                                    },
                                    "azimuth": {
                                        "degrees": "108.19",
                                        "string": "108° 11' 24\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "20.16",
                                        "string": "20h 09m 36s"
                                    },
                                    "declination": {
                                        "degrees": "-20.48",
                                        "string": "-21° 31' 12\""
                                    }
                                },
                                "constellation": {
                                    "id": "cap",
                                    "short": "Cap",
                                    "name": "Capricornus"
                                }
                            },
                            "extraInfo": {
                                "elongation": 30.30092,
                                "magnitude": 0.51024
                            }
                        },
                        {
                            "date": "2020-12-22T09:00:00.000-05:00",
                            "id": "saturn",
                            "name": "Saturn",
                            "distance": {
                                "fromEarth": {
                                    "au": "10.83377",
                                    "km": "1620708246.11400"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-8.81",
                                        "string": "-9° 11' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "108.68",
                                        "string": "108° 40' 48\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-8.81",
                                        "string": "-9° 11' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "108.68",
                                        "string": "108° 40' 48\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "20.17",
                                        "string": "20h 10m 12s"
                                    },
                                    "declination": {
                                        "degrees": "-20.46",
                                        "string": "-21° 32' 24\""
                                    }
                                },
                                "constellation": {
                                    "id": "cap",
                                    "short": "Cap",
                                    "name": "Capricornus"
                                }
                            },
                            "extraInfo": {
                                "elongation": 29.39097,
                                "magnitude": 0.5094
                            }
                        },
                        {
                            "date": "2020-12-23T09:00:00.000-05:00",
                            "id": "saturn",
                            "name": "Saturn",
                            "distance": {
                                "fromEarth": {
                                    "au": "10.84177",
                                    "km": "1621906121.81073"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-8.15",
                                        "string": "-9° 51' 0\""
                                    },
                                    "azimuth": {
                                        "degrees": "109.17",
                                        "string": "109° 10' 12\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-8.15",
                                        "string": "-9° 51' 0\""
                                    },
                                    "azimuth": {
                                        "degrees": "109.17",
                                        "string": "109° 10' 12\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "20.18",
                                        "string": "20h 10m 48s"
                                    },
                                    "declination": {
                                        "degrees": "-20.44",
                                        "string": "-21° 33' 36\""
                                    }
                                },
                                "constellation": {
                                    "id": "cap",
                                    "short": "Cap",
                                    "name": "Capricornus"
                                }
                            },
                            "extraInfo": {
                                "elongation": 28.48161,
                                "magnitude": 0.5085
                            }
                        }
                    ]
                },
                {
                    "entry": {
                        "id": "uranus",
                        "name": "Uranus"
                    },
                    "cells": [
                        {
                            "date": "2020-12-20T09:00:00.000-05:00",
                            "id": "uranus",
                            "name": "Uranus",
                            "distance": {
                                "fromEarth": {
                                    "au": "19.15312",
                                    "km": "2865265539.77370"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-37.43",
                                        "string": "-38° 34' 12\""
                                    },
                                    "azimuth": {
                                        "degrees": "0.51",
                                        "string": "0° 30' 36\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-37.43",
                                        "string": "-38° 34' 12\""
                                    },
                                    "azimuth": {
                                        "degrees": "0.51",
                                        "string": "0° 30' 36\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "2.30",
                                        "string": "02h 18m 00s"
                                    },
                                    "declination": {
                                        "degrees": "13.32",
                                        "string": "13° 19' 12\""
                                    }
                                },
                                "constellation": {
                                    "id": "ari",
                                    "short": "Ari",
                                    "name": "Aries"
                                }
                            },
                            "extraInfo": {
                                "elongation": 127.83315,
                                "magnitude": 5.70738
                            }
                        },
                        {
                            "date": "2020-12-21T09:00:00.000-05:00",
                            "id": "uranus",
                            "name": "Uranus",
                            "distance": {
                                "fromEarth": {
                                    "au": "19.16677",
                                    "km": "2867307491.50676"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-37.42",
                                        "string": "-38° 34' 48\""
                                    },
                                    "azimuth": {
                                        "degrees": "1.75",
                                        "string": "1° 45' 0\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-37.42",
                                        "string": "-38° 34' 48\""
                                    },
                                    "azimuth": {
                                        "degrees": "1.75",
                                        "string": "1° 45' 0\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "2.30",
                                        "string": "02h 18m 00s"
                                    },
                                    "declination": {
                                        "degrees": "13.31",
                                        "string": "13° 18' 36\""
                                    }
                                },
                                "constellation": {
                                    "id": "ari",
                                    "short": "Ari",
                                    "name": "Aries"
                                }
                            },
                            "extraInfo": {
                                "elongation": 126.79454,
                                "magnitude": 5.70899
                            }
                        },
                        {
                            "date": "2020-12-22T09:00:00.000-05:00",
                            "id": "uranus",
                            "name": "Uranus",
                            "distance": {
                                "fromEarth": {
                                    "au": "19.18060",
                                    "km": "2869376959.86400"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-37.39",
                                        "string": "-38° 36' 36\""
                                    },
                                    "azimuth": {
                                        "degrees": "2.99",
                                        "string": "2° 59' 24\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-37.39",
                                        "string": "-38° 36' 36\""
                                    },
                                    "azimuth": {
                                        "degrees": "2.99",
                                        "string": "2° 59' 24\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "2.30",
                                        "string": "02h 18m 00s"
                                    },
                                    "declination": {
                                        "degrees": "13.31",
                                        "string": "13° 18' 36\""
                                    }
                                },
                                "constellation": {
                                    "id": "ari",
                                    "short": "Ari",
                                    "name": "Aries"
                                }
                            },
                            "extraInfo": {
                                "elongation": 125.75664,
                                "magnitude": 5.71062
                            }
                        },
                        {
                            "date": "2020-12-23T09:00:00.000-05:00",
                            "id": "uranus",
                            "name": "Uranus",
                            "distance": {
                                "fromEarth": {
                                    "au": "19.19461",
                                    "km": "2871473223.65600"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-37.35",
                                        "string": "-38° 39' 0\""
                                    },
                                    "azimuth": {
                                        "degrees": "4.22",
                                        "string": "4° 13' 12\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-37.35",
                                        "string": "-38° 39' 0\""
                                    },
                                    "azimuth": {
                                        "degrees": "4.22",
                                        "string": "4° 13' 12\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "2.30",
                                        "string": "02h 18m 00s"
                                    },
                                    "declination": {
                                        "degrees": "13.30",
                                        "string": "13° 18' 0\""
                                    }
                                },
                                "constellation": {
                                    "id": "ari",
                                    "short": "Ari",
                                    "name": "Aries"
                                }
                            },
                            "extraInfo": {
                                "elongation": 124.71946,
                                "magnitude": 5.71227
                            }
                        }
                    ]
                },
                {
                    "entry": {
                        "id": "neptune",
                        "name": "Neptune"
                    },
                    "cells": [
                        {
                            "date": "2020-12-20T09:00:00.000-05:00",
                            "id": "neptune",
                            "name": "Neptune",
                            "distance": {
                                "fromEarth": {
                                    "au": "30.09446",
                                    "km": "4502067145.81014"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-36.83",
                                        "string": "-37° 10' 12\""
                                    },
                                    "azimuth": {
                                        "degrees": "63.12",
                                        "string": "63° 7' 12\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-36.83",
                                        "string": "-37° 10' 12\""
                                    },
                                    "azimuth": {
                                        "degrees": "63.12",
                                        "string": "63° 7' 12\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "23.29",
                                        "string": "23h 17m 24s"
                                    },
                                    "declination": {
                                        "degrees": "-5.74",
                                        "string": "-6° 15' 36\""
                                    }
                                },
                                "constellation": {
                                    "id": "aqr",
                                    "short": "Aqr",
                                    "name": "Aquarius"
                                }
                            },
                            "extraInfo": {
                                "elongation": 79.15329,
                                "magnitude": 7.90302
                            }
                        },
                        {
                            "date": "2020-12-21T09:00:00.000-05:00",
                            "id": "neptune",
                            "name": "Neptune",
                            "distance": {
                                "fromEarth": {
                                    "au": "30.11148",
                                    "km": "4504612627.51585"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-36.14",
                                        "string": "-37° 51' 36\""
                                    },
                                    "azimuth": {
                                        "degrees": "63.98",
                                        "string": "63° 58' 48\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-36.14",
                                        "string": "-37° 51' 36\""
                                    },
                                    "azimuth": {
                                        "degrees": "63.98",
                                        "string": "63° 58' 48\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "23.29",
                                        "string": "23h 17m 24s"
                                    },
                                    "declination": {
                                        "degrees": "-5.73",
                                        "string": "-6° 16' 12\""
                                    }
                                },
                                "constellation": {
                                    "id": "aqr",
                                    "short": "Aqr",
                                    "name": "Aquarius"
                                }
                            },
                            "extraInfo": {
                                "elongation": 78.14765,
                                "magnitude": 7.90424
                            }
                        },
                        {
                            "date": "2020-12-22T09:00:00.000-05:00",
                            "id": "neptune",
                            "name": "Neptune",
                            "distance": {
                                "fromEarth": {
                                    "au": "30.12843",
                                    "km": "4507148789.99699"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-35.44",
                                        "string": "-36° 33' 36\""
                                    },
                                    "azimuth": {
                                        "degrees": "64.82",
                                        "string": "64° 49' 12\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-35.44",
                                        "string": "-36° 33' 36\""
                                    },
                                    "azimuth": {
                                        "degrees": "64.82",
                                        "string": "64° 49' 12\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "23.29",
                                        "string": "23h 17m 24s"
                                    },
                                    "declination": {
                                        "degrees": "-5.73",
                                        "string": "-6° 16' 12\""
                                    }
                                },
                                "constellation": {
                                    "id": "aqr",
                                    "short": "Aqr",
                                    "name": "Aquarius"
                                }
                            },
                            "extraInfo": {
                                "elongation": 77.14251,
                                "magnitude": 7.90546
                            }
                        },
                        {
                            "date": "2020-12-23T09:00:00.000-05:00",
                            "id": "neptune",
                            "name": "Neptune",
                            "distance": {
                                "fromEarth": {
                                    "au": "30.14531",
                                    "km": "4509674873.44766"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-34.75",
                                        "string": "-35° 15' 0\""
                                    },
                                    "azimuth": {
                                        "degrees": "65.65",
                                        "string": "65° 39' 0\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-34.75",
                                        "string": "-35° 15' 0\""
                                    },
                                    "azimuth": {
                                        "degrees": "65.65",
                                        "string": "65° 39' 0\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "23.30",
                                        "string": "23h 18m 00s"
                                    },
                                    "declination": {
                                        "degrees": "-5.72",
                                        "string": "-6° 16' 48\""
                                    }
                                },
                                "constellation": {
                                    "id": "aqr",
                                    "short": "Aqr",
                                    "name": "Aquarius"
                                }
                            },
                            "extraInfo": {
                                "elongation": 76.13788,
                                "magnitude": 7.90668
                            }
                        }
                    ]
                },
                {
                    "entry": {
                        "id": "pluto",
                        "name": "Pluto"
                    },
                    "cells": [
                        {
                            "date": "2020-12-20T09:00:00.000-05:00",
                            "id": "pluto",
                            "name": "Pluto",
                            "distance": {
                                "fromEarth": {
                                    "au": "35.07463",
                                    "km": "5247089237.02526"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-6.48",
                                        "string": "-7° 31' 12\""
                                    },
                                    "azimuth": {
                                        "degrees": "113.25",
                                        "string": "113° 15' 0\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-6.48",
                                        "string": "-7° 31' 12\""
                                    },
                                    "azimuth": {
                                        "degrees": "113.25",
                                        "string": "113° 15' 0\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "19.71",
                                        "string": "19h 42m 36s"
                                    },
                                    "declination": {
                                        "degrees": "-22.55",
                                        "string": "-23° 27' 0\""
                                    }
                                },
                                "constellation": {
                                    "id": "sgr",
                                    "short": "Sgr",
                                    "name": "Sagittarius"
                                }
                            },
                            "extraInfo": {
                                "elongation": 24.70196,
                                "magnitude": 14.4218
                            }
                        },
                        {
                            "date": "2020-12-21T09:00:00.000-05:00",
                            "id": "pluto",
                            "name": "Pluto",
                            "distance": {
                                "fromEarth": {
                                    "au": "35.08240",
                                    "km": "5248252178.78916"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-5.79",
                                        "string": "-6° 12' 36\""
                                    },
                                    "azimuth": {
                                        "degrees": "113.81",
                                        "string": "113° 48' 36\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-5.79",
                                        "string": "-6° 12' 36\""
                                    },
                                    "azimuth": {
                                        "degrees": "113.81",
                                        "string": "113° 48' 36\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "19.71",
                                        "string": "19h 42m 36s"
                                    },
                                    "declination": {
                                        "degrees": "-22.54",
                                        "string": "-23° 27' 36\""
                                    }
                                },
                                "constellation": {
                                    "id": "sgr",
                                    "short": "Sgr",
                                    "name": "Sagittarius"
                                }
                            },
                            "extraInfo": {
                                "elongation": 23.71572,
                                "magnitude": 14.42128
                            }
                        },
                        {
                            "date": "2020-12-22T09:00:00.000-05:00",
                            "id": "pluto",
                            "name": "Pluto",
                            "distance": {
                                "fromEarth": {
                                    "au": "35.08990",
                                    "km": "5249374682.88083"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-5.11",
                                        "string": "-6° 53' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "114.37",
                                        "string": "114° 22' 12\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-5.11",
                                        "string": "-6° 53' 24\""
                                    },
                                    "azimuth": {
                                        "degrees": "114.37",
                                        "string": "114° 22' 12\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "19.71",
                                        "string": "19h 42m 36s"
                                    },
                                    "declination": {
                                        "degrees": "-22.54",
                                        "string": "-23° 27' 36\""
                                    }
                                },
                                "constellation": {
                                    "id": "sgr",
                                    "short": "Sgr",
                                    "name": "Sagittarius"
                                }
                            },
                            "extraInfo": {
                                "elongation": 22.72971,
                                "magnitude": 14.42074
                            }
                        },
                        {
                            "date": "2020-12-23T09:00:00.000-05:00",
                            "id": "pluto",
                            "name": "Pluto",
                            "distance": {
                                "fromEarth": {
                                    "au": "35.09713",
                                    "km": "5250456491.43196"
                                }
                            },
                            "position": {
                                "horizontal": {
                                    "altitude": {
                                        "degrees": "-4.43",
                                        "string": "-5° 34' 12\""
                                    },
                                    "azimuth": {
                                        "degrees": "114.94",
                                        "string": "114° 56' 24\""
                                    }
                                },
                                "horizonal": {
                                    "altitude": {
                                        "degrees": "-4.43",
                                        "string": "-5° 34' 12\""
                                    },
                                    "azimuth": {
                                        "degrees": "114.94",
                                        "string": "114° 56' 24\""
                                    }
                                },
                                "equatorial": {
                                    "rightAscension": {
                                        "hours": "19.71",
                                        "string": "19h 42m 36s"
                                    },
                                    "declination": {
                                        "degrees": "-22.54",
                                        "string": "-23° 27' 36\""
                                    }
                                },
                                "constellation": {
                                    "id": "sgr",
                                    "short": "Sgr",
                                    "name": "Sagittarius"
                                }
                            },
                            "extraInfo": {
                                "elongation": 21.74396,
                                "magnitude": 14.42017
                            }
                        }
                    ]
                }
            ]
        }
    }
}
```

{% endtab %}
{% endtabs %}

## Get body positions

<mark style="color:blue;">`GET`</mark> `https://api.astronomyapi.com/api/v2/bodies/positions/:body`

Returns properties for the given body for the given date range in tabular format.

#### Path Parameters

| Name                                   | Type   | Description    |
| -------------------------------------- | ------ | -------------- |
| body<mark style="color:red;">\*</mark> | string | ID of the body |

#### Query Parameters

| Name                                         | Type   | Description                                                                                                                 |
| -------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------- |
| latitude<mark style="color:red;">\*</mark>   | string | Latitude of the observer's location                                                                                         |
| longitude<mark style="color:red;">\*</mark>  | string | Longitude of the observer's location                                                                                        |
| elevation<mark style="color:red;">\*</mark>  | string | Elevation from the sea in Meters                                                                                            |
| from\_date<mark style="color:red;">\*</mark> | string | Starting date as Date. The maximum number of days you can query is 366 days.                                                |
| to\_date<mark style="color:red;">\*</mark>   | string | Ending date as Date. The maximum number of days you can query is 366 days.                                                  |
| time<mark style="color:red;">\*</mark>       | string | Observer's time as Time                                                                                                     |
| output                                       | string | <p>Output format.</p><p><code>rows</code></p><p>or</p><p><code>table</code></p><p>. Default is</p><p><code>table</code></p> |

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | string | Basic       |

{% tabs %}
{% tab title="200: OK Response for a request made with " %}

```javascript
{
    "data": {
        "dates": {
            "from": "2020-12-20T09:00:00.000-05:00",
            "to": "2020-12-23T09:00:00.000-05:00"
        },
        "observer": {
            "location": {
                "longitude": -84.39733,
                "latitude": 38.775867,
                "elevation": 1
            }
        },
        "rows": [
            {
                "body": {
                    "id": "moon",
                    "name": "Moon"
                },
                "positions": [
                    {
                        "date": "2020-12-20T09:00:00.000-05:00",
                        "id": "moon",
                        "name": "Moon",
                        "distance": {
                            "fromEarth": {
                                "au": "0.00267",
                                "km": "398770.33905"
                            }
                        },
                        "position": {
                            "horizontal": {
                                "altitude": {
                                    "degrees": "-39.40",
                                    "string": "-40° 36' 0\""
                                },
                                "azimuth": {
                                    "degrees": "70.99",
                                    "string": "70° 59' 24\""
                                }
                            },
                            "horizonal": {
                                "altitude": {
                                    "degrees": "-39.40",
                                    "string": "-40° 36' 0\""
                                },
                                "azimuth": {
                                    "degrees": "70.99",
                                    "string": "70° 59' 24\""
                                }
                            },
                            "equatorial": {
                                "rightAscension": {
                                    "hours": "23.13",
                                    "string": "23h 07m 48s"
                                },
                                "declination": {
                                    "degrees": "-11.96",
                                    "string": "-12° 2' 24\""
                                }
                            },
                            "constellation": {
                                "id": "aqr",
                                "short": "Aqr",
                                "name": "Aquarius"
                            }
                        },
                        "extraInfo": {
                            "elongation": 74.27557,
                            "magnitude": -9.45722,
                            "phase": {
                                "angel": "74.2018",
                                "fraction": "0.042",
                                "string": "Waxing Crescent"
                            }
                        }
                    },
                    {
                        "date": "2020-12-21T09:00:00.000-05:00",
                        "id": "moon",
                        "name": "Moon",
                        "distance": {
                            "fromEarth": {
                                "au": "0.00270",
                                "km": "403433.20074"
                            }
                        },
                        "position": {
                            "horizontal": {
                                "altitude": {
                                    "degrees": "-43.26",
                                    "string": "-44° 44' 24\""
                                },
                                "azimuth": {
                                    "degrees": "56.79",
                                    "string": "56° 47' 24\""
                                }
                            },
                            "horizonal": {
                                "altitude": {
                                    "degrees": "-43.26",
                                    "string": "-44° 44' 24\""
                                },
                                "azimuth": {
                                    "degrees": "56.79",
                                    "string": "56° 47' 24\""
                                }
                            },
                            "equatorial": {
                                "rightAscension": {
                                    "hours": "23.89",
                                    "string": "23h 53m 24s"
                                },
                                "declination": {
                                    "degrees": "-7.15",
                                    "string": "-8° 51' 0\""
                                }
                            },
                            "constellation": {
                                "id": "aqr",
                                "short": "Aqr",
                                "name": "Aquarius"
                            }
                        },
                        "extraInfo": {
                            "elongation": 85.52956,
                            "magnitude": -9.90583,
                            "phase": {
                                "angel": "85.5048",
                                "fraction": "0.036",
                                "string": "Waxing Crescent"
                            }
                        }
                    },
                    {
                        "date": "2020-12-22T09:00:00.000-05:00",
                        "id": "moon",
                        "name": "Moon",
                        "distance": {
                            "fromEarth": {
                                "au": "0.00272",
                                "km": "406803.88314"
                            }
                        },
                        "position": {
                            "horizontal": {
                                "altitude": {
                                    "degrees": "-45.10",
                                    "string": "-46° 54' 0\""
                                },
                                "azimuth": {
                                    "degrees": "41.52",
                                    "string": "41° 31' 12\""
                                }
                            },
                            "horizonal": {
                                "altitude": {
                                    "degrees": "-45.10",
                                    "string": "-46° 54' 0\""
                                },
                                "azimuth": {
                                    "degrees": "41.52",
                                    "string": "41° 31' 12\""
                                }
                            },
                            "equatorial": {
                                "rightAscension": {
                                    "hours": "0.61",
                                    "string": "00h 36m 36s"
                                },
                                "declination": {
                                    "degrees": "-2.20",
                                    "string": "-3° 48' 0\""
                                }
                            },
                            "constellation": {
                                "id": "cet",
                                "short": "Cet",
                                "name": "Cetus"
                            }
                        },
                        "extraInfo": {
                            "elongation": 96.54755,
                            "magnitude": -10.29789,
                            "phase": {
                                "angel": "96.5672",
                                "fraction": "0.030",
                                "string": "Waxing Gibbous"
                            }
                        }
                    },
                    {
                        "date": "2020-12-23T09:00:00.000-05:00",
                        "id": "moon",
                        "name": "Moon",
                        "distance": {
                            "fromEarth": {
                                "au": "0.00273",
                                "km": "408768.64035"
                            }
                        },
                        "position": {
                            "horizontal": {
                                "altitude": {
                                    "degrees": "-44.84",
                                    "string": "-45° 9' 36\""
                                },
                                "azimuth": {
                                    "degrees": "26.04",
                                    "string": "26° 2' 24\""
                                }
                            },
                            "horizonal": {
                                "altitude": {
                                    "degrees": "-44.84",
                                    "string": "-45° 9' 36\""
                                },
                                "azimuth": {
                                    "degrees": "26.04",
                                    "string": "26° 2' 24\""
                                }
                            },
                            "equatorial": {
                                "rightAscension": {
                                    "hours": "1.32",
                                    "string": "01h 19m 12s"
                                },
                                "declination": {
                                    "degrees": "2.74",
                                    "string": "2° 44' 24\""
                                }
                            },
                            "constellation": {
                                "id": "psc",
                                "short": "Psc",
                                "name": "Pisces"
                            }
                        },
                        "extraInfo": {
                            "elongation": 107.41558,
                            "magnitude": -10.65118,
                            "phase": {
                                "angel": "107.4676",
                                "fraction": "0.023",
                                "string": "Waxing Gibbous"
                            }
                        }
                    }
                ]
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}


# Events

Get celestial events for a given body for the given date range.

Events API can return events for a single body for the given date range. In the events API currently, only the bodies `Sun` and `Moon` are supported.

See [Event Properties](/requests-and-response/event-properties) for available event properties for bodies.

## Get events for the given body

<mark style="color:blue;">`GET`</mark> `https://api.astronomyapi.com/api/v2/bodies/events/:body`

Returns events for the given body for the given date range in tabular format.

#### Path Parameters

| Name                                   | Type   | Description    |
| -------------------------------------- | ------ | -------------- |
| body<mark style="color:red;">\*</mark> | string | ID of the body |

#### Query Parameters

| Name                                         | Type   | Description                                                                                                                 |
| -------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------- |
| latitude<mark style="color:red;">\*</mark>   | string | Latitude of the observer's location                                                                                         |
| longitude<mark style="color:red;">\*</mark>  | string | Longitude of the observer's location                                                                                        |
| elevation<mark style="color:red;">\*</mark>  | string | Elevation from the sea in Meters                                                                                            |
| from\_date<mark style="color:red;">\*</mark> | string | Starting date as Date. The maximum number of days you can query is 366 days.                                                |
| to\_date<mark style="color:red;">\*</mark>   | string | Ending date as Date. The maximum number of days you can query is 366 days.                                                  |
| time<mark style="color:red;">\*</mark>       | string | Observer's time as Time                                                                                                     |
| output                                       | string | <p>Output format.</p><p><code>rows</code></p><p>or</p><p><code>table</code></p><p>. Default is</p><p><code>table</code></p> |

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | string | Basic       |

{% tabs %}
{% tab title="200: OK Response for a request made with " %}

```javascript
{
    "data": {
        "dates": {
            "from": "2020-12-20T09:00:00.000-05:00",
            "to": "2021-12-23T09:00:00.000-05:00"
        },
        "observer": {
            "location": {
                "longitude": -84.39733,
                "latitude": 38.775867,
                "elevation": 0
            }
        },
        "rows": [
            {
                "body": {
                    "id": "sun",
                    "name": "Sun"
                },
                "events": [
                    {
                        "type": "partial_solar_eclipse",
                        "eventHighlights": {
                            "partialStart": {
                                "date": "2021-06-10T03:45:15.241-05:00",
                                "altitude": -13.56
                            },
                            "totalStart": null,
                            "peak": {
                                "date": "2021-06-10T04:37:30.267-05:00",
                                "altitude": -5.85
                            },
                            "totalEnd": null,
                            "patialEnd": {
                                "date": "2021-06-10T05:32:52.677-05:00",
                                "altitude": 2.92
                            }
                        },
                        "rise": "2021-06-10T10:12:14.143Z",
                        "set": "2021-06-11T01:02:13.766Z",
                        "extraInfo": {
                            "obscuration": 0.76
                        }
                    }
                ]
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}


# Studio

Astronomy API Studio enables you to generate images and charts based on data you provide.

This section describes how you can generate images using the API.

If you're looking to quickly integrate this with your website refer to [Widgets](/widgets)


# Star Chart

Generates a star chart with the given parameters, and returns the url.

If you're looking to quickly integrate this feature on your website without making API calls, checkout [Widgets](/widgets)

## Generate star chart

<mark style="color:green;">`POST`</mark> `https://api.astronomyapi.com/api/v2/studio/star-chart`

#### Headers

| Name                                            | Type   | Description   |
| ----------------------------------------------- | ------ | ------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Basic \<hash> |

#### Request Body

| Name                                       | Type   | Description                                                                                                                                                                     |
| ------------------------------------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| style                                      | string | Style of the map to be generated. If not provided will use the default style. To see a demo of available styles see styles section on this page.                                |
| observer<mark style="color:red;">\*</mark> | object | Observer object must contain the `latitude`, `longitude` and `date` of the observer.                                                                                            |
| view<mark style="color:red;">\*</mark>     | object | View object is used to configure the view of the rendered image. The view object must contain a `type` and `parameters` object. Parameters object can vary based on the `type`. |

{% tabs %}
{% tab title="200: OK " %}

```typescript
{
 "data": {
     "imageUrl": "https://widgets.astronomyapi.com/star-chart/generated/1234567890.png"
  }
}
```

{% endtab %}
{% endtabs %}

### Rendering different views

#### Constellation

To generate an image of a constellation the `type` in the `view` object must be set to `constellation`. The 3 letter ID of the constellation must be passed in the parameters for the view object. For a complete list of constellation IDs see [Contellation Enums](/requests-and-response/constellation-enums)

{% hint style="info" %}
The 3 letter constellation ID is case sensitive, only lower case is allowed
{% endhint %}

```typescript
{
    "style": "inverted",
    "observer": {
        "latitude": 33.775867,
        "longitude": -84.39733,
        "date": "2019-12-20"
    },
    "view": {
        "type": "constellation",
        "parameters": {
            "constellation": "ori" // 3 letter constellation id
        }
    }
}
```

#### Area

To generate an image of an area in the sky, set the `type` to `area`, then pass the RA and Dec values in the `position` object for the view `parameters`. Currently equatorial coordinates are supported by the API. Additionally the parameter `zoom` can be provided to scale the image, but it's optional.

```typescript
// Note how this request does not have the field `style` 
// The API will use the default style
{
    "observer": {
        "latitude": 33.775867,
        "longitude": -84.39733,
        "date": "2019-12-20"
    },
    "view": {
        "type": "area",
        "parameters": {
            "position": {
                "equatorial": {
                    "rightAscension": 14.83,
                    "declination": -15.23
                }
            },
            "zoom": 3 //optional
        }
    }
}
```

## Styles

### `default`

![](https://1238588302-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKQ7_I-c79Ln1c6Chop-3789850253%2Fuploads%2Fgit-blob-cd57bfe050170444bddc92465915381219eb96bc%2Fa458456e6535de44ec8cf5fc78e54230efd961319d1e04615235585de53a4c98.png?alt=media)

### `inverted`

![](https://1238588302-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKQ7_I-c79Ln1c6Chop-3789850253%2Fuploads%2Fgit-blob-2e021974662270ee20a04677752552587b0154c7%2Fd11505ad53287e9bbb36be2f059b09fa3e0b765408e2df6659bb8e37957668db.png?alt=media)

### `navy`

![](https://1238588302-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKQ7_I-c79Ln1c6Chop-3789850253%2Fuploads%2Fgit-blob-ba3eaf72d6ef405c81e79112a699ef8fd2837378%2Fb7654698395061f2e6985b49c5f9b4e6a55c5aec350f9919a3e00818c701d199.png?alt=media)

### `red`

![](https://1238588302-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKQ7_I-c79Ln1c6Chop-3789850253%2Fuploads%2Fgit-blob-fa16f2e6f0527bf00e55ad8463e34249b536f0e7%2F9094a7b39b3ff6b06cf577ceb8f4c1cac3d2aa25fd07c74cb23f109ff32f5f59.png?alt=media)


# Moon Phase

Generate an image of the Moon based on the given parameters.

If you're looking to quickly integrate this feature on your website without making API calls, checkout [Widgets](/widgets)

## Generate Moon Phase

<mark style="color:green;">`POST`</mark> `https://api.astronomyapi.com/api/v2/studio/moon-phase`

#### Headers

| Name                                            | Type   | Description   |
| ----------------------------------------------- | ------ | ------------- |
| Authorization<mark style="color:red;">\*</mark> | string | Basic \<hash> |

#### Request Body

| Name                                       | Type   | Description                                                                                                                                                                                                                                                                                                                                                        |
| ------------------------------------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| format                                     | string | Image format to be returned. Valid values are `png` or `svg`. Defaults to `png`                                                                                                                                                                                                                                                                                    |
| style                                      | object | Style object contains the styling parameters for the image generated.                                                                                                                                                                                                                                                                                              |
| observer<mark style="color:red;">\*</mark> | object | Observer object must contain the `latitude`, `longitude` and `date` of the observer.                                                                                                                                                                                                                                                                               |
| view<mark style="color:red;">\*</mark>     | object | <p>View object is used to configure the view of the rendered image. The view object must contain a <code>type</code> object.</p><p><code>orientation</code> specifies which side of the moon should be up depending on the hemisphere you live in the world. This parameter is optional. If not provided AstronomyAPI will determine the values automatically.</p> |

{% tabs %}
{% tab title="200: OK " %}

```typescript
{
    "data": {
        "imageUrl": "https://widgets.astronomyapi.com/moon-phase/generated/1234567890.png"
    }
}
```

{% endtab %}
{% endtabs %}

```typescript
{
    "format": "png",
    "style": {
        "moonStyle": "sketch",
        "backgroundStyle": "stars",
        "backgroundColor": "red",
        "headingColor": "white",
        "textColor": "red"
    },
    "observer": {
        "latitude": 6.56774,
        "longitude": 79.88956,
        "date": "2020-11-01"
    },
    "view": {
        "type": "portrait-simple",
        "orientation": "south-up"
    }
}
```

## Format

The API currently supports outputting images in `svg` and `png` formats. These can be used in different use cases, depending on how and where you want them to be displayed.

## Style

#### `moonStyle`

Valid values are `default`, `sketch` and `shaded.` Below are sample moons for each value.

<div align="left"><img src="https://1238588302-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKQ7_I-c79Ln1c6Chop-3789850253%2Fuploads%2Fgit-blob-8c8b7105a908ac3ac7ff1afbbe0d89645db3f3e5%2Fmoon.285d.png?alt=media" alt="default"></div>

<div align="left"><img src="https://1238588302-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKQ7_I-c79Ln1c6Chop-3789850253%2Fuploads%2Fgit-blob-2e4a15a2d54d5506ec964880b6f5d0118b905c74%2Fmoon.285s.png?alt=media" alt="shaded"></div>

<div align="left"><img src="https://1238588302-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKQ7_I-c79Ln1c6Chop-3789850253%2Fuploads%2Fgit-blob-79932aedf77d63ed32e5907f0e90b1b50202d3da%2Fmoon.285k.png?alt=media" alt="sketch"></div>

#### `backgroundStyle`

Background style supports the values either `stars` or `solid`. Passing `stars` will render a stars background while `solid` will render the background with a solid color specified by the `backgroundColor` property.

#### `backgroundColor, headingColor and textColor`

These properties could be used to customise the image further. Colours could be defined as hex or as any of the [140 html colour names](https://www.w3schools.com/tags/ref_colornames.asp).

## View

#### `type`

The type parameter in the view object should specify which template to be used when rendering the image. Currently two templates are available.

<div align="left"><img src="https://1238588302-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKQ7_I-c79Ln1c6Chop-3789850253%2Fuploads%2Fgit-blob-4bc26e18f1ab65ef1c4ae513457f73d9240f2766%2Fe86043757e0a337db6d529d42e6c67e9e832b104f75d92bf9e6a09fc4d44cc25.png?alt=media" alt="portrait-simple"></div>

<div align="left"><img src="https://1238588302-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKQ7_I-c79Ln1c6Chop-3789850253%2Fuploads%2Fgit-blob-2a43500a0caf0bef077b3bee4be2a818d54d7ff6%2Ff2968861e774a453f7826a48bb0c1f41c22693a3b58475cbec0435e97171d8e2.png?alt=media" alt="landscape-simple"></div>

#### `orientation`

Orientation parameter in the view object, determines which orientation to use when rendering the moon. By default it will render north side up, as seen by an observer facing the south side of the sky. This parameter is optional.

Below is an example of the same image with different orientations.

<div align="left"><img src="https://1238588302-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKQ7_I-c79Ln1c6Chop-3789850253%2Fuploads%2Fgit-blob-3e3433eaf5db74274424ecd3bd73c5a1ded5e6f9%2F33574d6b80418fce7f3cb4ba97e09ea0f460f7780b6a3367dda5e58643896230.png?alt=media" alt="north-up"></div>

<div align="left"><img src="https://1238588302-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MKQ7_I-c79Ln1c6Chop-3789850253%2Fuploads%2Fgit-blob-2d4e0035905a7ff77a4e126b3b05bd8bfa776fc2%2F0b12c46d2b33d72b4f848cd40d878221e57689ab2880d104d615721912dd5593.png?alt=media" alt="south-up"></div>


# Search

Search for stars and deep space objects.

Search endpoint can be used to get information for stars and deep space objects.

The response of this endpoint is an array of objects which is representing the results. Depending on the matching criteria, the resulting items could be of object type `star` or a `deep space object`.

See [Search Result Properties](/requests-and-response/body-properties-1) for information on response object details.

## Get available bodies

<mark style="color:blue;">`GET`</mark> `https://api.astronomyapi.com/api/v2/search`

Returns a list of results based on the requested query

#### Query Parameters

| Name                                          | Type   | Description                                                                                                                                                                                                                                                                                            |
| --------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| term<mark style="color:red;">\*</mark>        | string | <p>Search term. Conditionally required if</p><p><code>ra</code></p><p>and</p><p><code>dec</code></p><p>values are not provided for area search.</p>                                                                                                                                                    |
| match\_type<mark style="color:red;">\*</mark> | string | <p>Matching algorithm. Valid values are</p><p><code>fuzzy</code></p><p>or</p><p><code>exact</code></p><p>. A fuzzy match will return results starting with the given term while an exact match will exactly match the term. Defaults to</p><p><code>fuzzy</code></p><p>. Optional for term search.</p> |
| ra<mark style="color:red;">\*</mark>          | string | <p>Right ascension value to search around. Must be a decimal value as a string representation. Required if</p><p><code>dec</code></p><p>value is provided.</p>                                                                                                                                         |
| dec<mark style="color:red;">\*</mark>         | string | <p>Declination value to search around. Must be a decimal value as a string representation. Required if</p><p><code>ra</code></p><p>value is provided.</p>                                                                                                                                              |
| limit                                         | string | How many records to return in the request.                                                                                                                                                                                                                                                             |
| offset                                        | string | Use offset to paginate the results. 0 will return the first page, adding the limit to the offset will return the next page.                                                                                                                                                                            |
| order\_by                                     | string | <p>Order the results by the field. The supported value is</p><p><code>name</code></p><p>. Does not support during an area search.</p>                                                                                                                                                                  |

#### Headers

| Name                                            | Type   | Description |
| ----------------------------------------------- | ------ | ----------- |
| Authorization<mark style="color:red;">\*</mark> | string | Basic       |

{% tabs %}
{% tab title="200: OK The response with the term as " %}

```javascript
{
    "meta": {
        "limit": 10,
        "offset": 0
    },
    "data": [
        {
            "id": "f9ea7803-44d6-56ea-a4c5-714d74d31237",
            "name": "Orion Nebula",
            "type": {
                "id": "SNR",
                "name": "Super Nova Remnant"
            },
            "subType": {
                "id": "EN+RN"
            },
            "crossIdentification": [
                {
                    "name": "M 42",
                    "catalogId": "M"
                },
                {
                    "name": "NGC 1976",
                    "catalogId": "NGC"
                },
                {
                    "name": "LBN 974",
                    "catalogId": "LBN"
                },
                {
                    "name": "Orion Nebula",
                    "catalogId": null
                },
                {
                    "name": "Great Orion Nebula",
                    "catalogId": null
                }
            ],
            "position": {
                "equatorial": {
                    "rightAscension": {
                        "hours": "5.59",
                        "string": "05h 35m 24s"
                    },
                    "declination": {
                        "degrees": "-4.61",
                        "string": "-5° 23' 24\""
                    }
                },
                "constellation": {
                    "id": "ori",
                    "short": "Ori",
                    "name": "Orion"
                }
            }
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### Object types and sub types

Search API can only be used for searching stars and deep space objects. For searching for planets use the [positions API](/endpoints/bodies) instead. For a list of DOS types see [DSO enums](/requests-and-response/dso-enums)

### Object catalogs

The following object catalogs are available for searching. Please note all objects may not be present in the database for some catalogs.

<table><thead><tr><th width="95">ID</th><th>Name</th></tr></thead><tbody><tr><td>LBN</td><td>Lynds' Catalogue of Bright Nebulae</td></tr><tr><td>NGC</td><td>The New General Catalogue</td></tr><tr><td>HCG</td><td>A Hickson Compact Group</td></tr><tr><td>ZWG</td><td>The Catalogue of Galaxies and Clusters of Galaxies</td></tr><tr><td>HR</td><td>Revised Harvard Photometry</td></tr><tr><td>IC</td><td>Index Catalogue</td></tr><tr><td>UGC</td><td>The Uppsala General Catalogue of Galaxies</td></tr><tr><td>KUG</td><td>The Kiso Ultraviolet Galaxy Catalogue</td></tr><tr><td>FCC</td><td>A Catalogue and Photometric Properties of Galaxies</td></tr><tr><td>DDO</td><td>David Dunlap Observatory Catalogue</td></tr><tr><td>ARP</td><td>The Atlas of Peculiar Galaxies</td></tr><tr><td>MCG</td><td>Morphological Catalogue of Galaxies</td></tr><tr><td>ESO</td><td>The European Southern Observatory Catalogue</td></tr></tbody></table>


# Requests and Responses


# Body Properties

Plants, Sun and Moon entities respond with common object properties. This page describes what to expect in the response.

Body entities returned from the [Positions API](/endpoints/bodies/positions) consists of the following properties.

<table data-header-hidden><thead><tr><th>Section</th><th width="150">Subsection</th><th width="150">Data Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>Section</strong></td><td><strong>Subsection</strong></td><td><strong>Data Type</strong></td><td><strong>Description</strong></td></tr><tr><td>id</td><td>-</td><td>string</td><td>Unique identifier for the body</td></tr><tr><td>name</td><td>-</td><td>string</td><td>User friendly name for the body</td></tr><tr><td>distance</td><td>-</td><td>object</td><td>Distance object</td></tr><tr><td>-</td><td>fromEarth</td><td>object</td><td>Distance from Earth in Kilometers (km) and Astronomical units (au)</td></tr><tr><td>position</td><td>-</td><td>object</td><td>Position object</td></tr><tr><td>-</td><td>horizonal</td><td>object</td><td>Position object in horizontal coordinates. Object will return the values in Altitude and Azimuth (Alt/Az) format. Numerical and literal values are returned.</td></tr><tr><td>-</td><td>equatorial</td><td>object</td><td>Position object in equatorial coordinates. Object will return the values in Right Ascension and Declination (RA/Dec) format. Numerical and literal values are returned.</td></tr><tr><td>extraInfo</td><td>-</td><td>object</td><td>Other information relating to the body</td></tr><tr><td>-</td><td>elongation</td><td>string</td><td>Angular separation between the Sun and the planet, with Earth as the reference point</td></tr><tr><td>-</td><td>magnitude</td><td>string</td><td>Apparent magnitude of the object</td></tr><tr><td></td><td>phase</td><td>object</td><td>Phase of the body as an angle and a fraction.</td></tr></tbody></table>

{% hint style="info" %}
`phase` property is available only in the Moon body
{% endhint %}

#### Sample response object

```javascript
{
    "date": "2017-12-20T08:00:00.000Z",
    "id": "saturn",
    "name": "Saturn",
    "distance": {
        "fromEarth": {
            "au": "11.04833",
            "km": "1652807114.58763"
        }
    },
    "position": {
        "horizonal": {
            "altitude": {
                "degrees": "-57.37",
                "string": "-58&deg; 37' 48\""
            },
            "azimuth": {
                "degrees": "78.82",
                "string": "78&deg; 49' 12\""
            }
        },
        "equatorial": {
            "rightAscension": {
                "hours": "17.98",
                "string": "17h 58m 48s"
            },
            "declination": {
                "degrees": "-22.53",
                "string": "-23&deg; 28' 12\""
            }
        }
    },
    "extraInfo": {
        "elongation": "1.66392",
        "magnitude": "0.31200"
    }
}
```


# Event Properties

And Event object is returned when body events are requested using the[ Events API](/endpoints/bodies/events).

<table><thead><tr><th width="166">Section</th><th width="162">Sub Section</th><th width="113">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>type</td><td></td><td>string</td><td>Describes the event type. This can be either of <code>total_lunar_eclipse</code>, <code>total_solar_eclipse</code>, <code>annular_solar_eclipse</code>, <code>partial_solar_eclipse</code>, <code>partial_lunar_eclipse</code> or <code>penumbral_lunar_eclipse</code></td></tr><tr><td>eventHighlights</td><td>-</td><td>object</td><td>Contains the event highlights</td></tr><tr><td></td><td>penumbralStart</td><td>object</td><td>Start of the penumbral eclipse. Available for the moon only.</td></tr><tr><td></td><td>partialStart</td><td>object</td><td>Start of the partial eclipse and the altitude from the horizon. Available for both the sun and the moon,</td></tr><tr><td></td><td>fullStart</td><td>object</td><td>Start of the full eclipse and the altitude from the horizon. Available for the moon only.</td></tr><tr><td></td><td>totalStart</td><td>object</td><td>Start of the total eclipse and the altitude from the horizon. Available for the sun only.</td></tr><tr><td></td><td>peak</td><td>object</td><td>Peak of the event and the altitude from the horizon. Available for both the sun and the moon</td></tr><tr><td></td><td>totalEnd</td><td>object</td><td>End of the total eclipse and the altitude from the horizon. Available for the sun only.</td></tr><tr><td></td><td>fullEnd</td><td>object</td><td>End of the full eclipse and the altitude from the horizon. Available for the moon only.</td></tr><tr><td></td><td>partialEnd</td><td>object</td><td>End of the partial eclipse and the altitude from the horizon. Available for both the sun and the moon,</td></tr><tr><td></td><td>penumbralEnd</td><td>object</td><td>Endrt of the penumbral eclipse and the altitude from the horizon. Available for the moon only.</td></tr><tr><td></td><td>rise</td><td>object</td><td>Rise time of the object for the date and the altitude from the horizon.</td></tr><tr><td></td><td>set</td><td>object</td><td>Set time of the object for the date and the altitude from the horizon.</td></tr><tr><td></td><td>extraInfo</td><td>object</td><td>Any other information.</td></tr></tbody></table>

#### Sample response object

```json
{
    "data": {
        "dates": {
            "from": "2020-12-20T09:00:00.000-05:00",
            "to": "2022-12-23T09:00:00.000-05:00"
        },
        "observer": {
            "location": {
                "longitude": -84.39733,
                "latitude": 38.775867,
                "elevation": 0
            }
        },
        "rows": [
            {
                "body": {
                    "id": "sun",
                    "name": "Sun"
                },
                "events": [
                    {
                        "type": "partial_solar_eclipse",
                        "eventHighlights": {
                            "partialStart": {
                                "date": "2021-06-10T03:45:15.241-05:00",
                                "altitude": -13.56
                            },
                            "totalStart": null,
                            "peak": {
                                "date": "2021-06-10T04:37:30.267-05:00",
                                "altitude": -5.85
                            },
                            "totalEnd": null,
                            "patialEnd": {
                                "date": "2021-06-10T05:32:52.677-05:00",
                                "altitude": 2.92
                            }
                        },
                        "rise": "2021-06-10T10:12:14.143Z",
                        "set": "2021-06-11T01:02:13.766Z",
                        "extraInfo": {
                            "obscuration": 0.76
                        }
                    }
                ]
            }
        ]
    }
}
```

```json
{
    "data": {
        "dates": {
            "from": "2020-12-20T09:00:00.000-05:00",
            "to": "2022-12-23T09:00:00.000-05:00"
        },
        "observer": {
            "location": {
                "longitude": -84.39733,
                "latitude": 38.775867,
                "elevation": 0
            }
        },
        "rows": [
            {
                "body": {
                    "id": "moon",
                    "name": "Moon"
                },
                "events": [
                    {
                        "type": "total_lunar_eclipse",
                        "eventHighlights": {
                            "pemumbralStart": {
                                "date": "2022-05-15T20:32:25.341-05:00",
                                "altitude": 9.53
                            },
                            "partialStart": {
                                "date": "2022-05-15T21:28:25.341-05:00",
                                "altitude": 17.45
                            },
                            "fullStart": {
                                "date": "2022-05-15T22:29:25.341-05:00",
                                "altitude": 24.44
                            },
                            "peak": {
                                "date": "2022-05-15T23:11:25.341-05:00",
                                "altitude": 27.93
                            },
                            "fullEnd": {
                                "date": "2022-05-15T23:53:25.341-05:00",
                                "altitude": 30.09
                            },
                            "partialEnd": {
                                "date": "2022-05-16T00:54:25.341-05:00",
                                "altitude": 30.58
                            },
                            "pemumbralEnd": {
                                "date": "2022-05-16T01:50:25.341-05:00",
                                "altitude": 28.22
                            }
                        },
                        "rise": "2022-05-16T00:28:34.597Z",
                        "set": "2022-05-17T11:22:15.102Z",
                        "extraInfo": {
                            "obscuration": 1
                        }
                    }
                ]
            }
        ]
    }
}
```


# Search Result Properties

Search result items follows a common object schema. This page describes the different fields and what to expect as the values.

The following properties are returned in the search results objects returned from the API.

<table data-header-hidden><thead><tr><th>Section</th><th width="150">Subsection</th><th width="150">Data Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>Section</strong></td><td><strong>Subsection</strong></td><td><strong>Data Type</strong></td><td><strong>Description</strong></td></tr><tr><td>id</td><td>-</td><td>string</td><td>Unique identifier for the object.</td></tr><tr><td>name</td><td>-</td><td>string</td><td>Commonly used name for the object. If a name is not found defaults to the closest possible catalog id.</td></tr><tr><td>type</td><td>-</td><td>object</td><td>The type object.</td></tr><tr><td>-</td><td>id</td><td>string</td><td>The type of the object as a unique id.</td></tr><tr><td>-</td><td>name</td><td>string</td><td>The name of the type.</td></tr><tr><td>subType</td><td>-</td><td></td><td>Sub type object</td></tr><tr><td>-</td><td>id</td><td>string</td><td>The sub type of the object as a unique id. For stars this will return the spectral class while for DSO objects returns the sub type based on the type of the object.</td></tr><tr><td>-</td><td>name</td><td>string</td><td>The description or name of the sub type</td></tr><tr><td>crossIdentification</td><td>-</td><td>array</td><td>Returns any duplicated references in all catalogs. The array of objects consists of the <code>name</code> and the <code>catalogId</code> of the referring catalog.</td></tr><tr><td>position</td><td>-</td><td>object</td><td>Position object. Note that the object contains only the equatorial coordinates object and the constellation object.</td></tr><tr><td>-</td><td>equatorial</td><td>object</td><td>Position object in equatorial coordinates. Object will return the values in Right Ascension and Declination (RA/Dec) format. Numerical and literal values are returned.</td></tr><tr><td>-</td><td>constellation</td><td>object</td><td>The id, short code and the name of the constellation where the object can be seen in.</td></tr></tbody></table>

#### Sample response object

```javascript
{
    "meta": {
        "limit": 10,
        "offset": 0
    },
    "data": [
        {
            "id": "3ecb894e-99c0-5b4b-9fcf-6d4441fe351d",
            "name": "M 1",
            "type": {
                "id": "SNR",
                "name": "Super Nova Remnant"
            },
            "subType": {
                "id": "SNR",
                "name": "Super Nova Remnant"
            },
            "crossIdentification": [
                {
                    "name": "NGC 1952",
                    "catalogId": "NGC"
                },
                {
                    "name": "LBN 833",
                    "catalogId": "LBN"
                },
                {
                    "name": "Crab Nebula",
                    "catalogId": null
                },
                {
                    "name": "Taurus A",
                    "catalogId": null
                },
                {
                    "name": "M 1",
                    "catalogId": "M"
                }
            ],
            "position": {
                "equatorial": {
                    "rightAscension": {
                        "hours": "5.58",
                        "string": "05h 34m 48s"
                    },
                    "declination": {
                        "degrees": "22.01",
                        "string": "22° 0' 36\""
                    }
                },
                "constellation": {
                    "id": "tau",
                    "short": "Tau",
                    "name": "Taurus"
                }
            }
        }
    ]
}
```


# Observer Parameters

When requesting for location and/or date-time related data, Observer parameters must be sent in the request.

Observer Parameters include the current observer's location and other information. The casing of the properties changes from camel case to snake case when doing a GET request.

| **Parameter**         | **Required** | **Description**                                                          | Sample Value |
| --------------------- | :----------: | ------------------------------------------------------------------------ | ------------ |
| longitude             |      Yes     | Longitude of the observer's location, as Float                           | -84.39733    |
| latitude              |      Yes     | Latitude of the observer's location, as Float                            | 33.775867    |
| elevation             |      Yes     | Elevation from the sea in Meters as Number                               | 50           |
| from\_date / fromDate |      Yes     | Starting date as Date. When doing a GET request from\_date must be used. | 2018-12-20   |
| to\_date / toDate     |      Yes     | Ending date as Date. When doing a GET request to\_date must be used.     | 2018-12-22   |
| time                  |      Yes     | Observer's time as Time                                                  | 08:00:00     |

## Time and Timezones

Astronomy API treats the time requested, as the observer's time. It finds the timezone of the user based on the location specified by `longitude` and `latitude`. The returned times will be as same as the time zone requested.


# Tabular Responses

Some endpoints return data in tabular format for easy template rendering.

Certain API endpoints might return you data in a tabular format, thus making it easier for you to render them in your template files.

You can get the `table` object from response object using `data.table`.

```javascript
{
    "data": {
        "dates": {
            "from": "2016-12-20T00:00:00",
            "to": "2016-12-22T23:59:59"
        },
        "observer": {
            "location": {
                "longitude": -84.39733,
                "latitude": 33.775867,
                "elevation": 1000
            }
        },
        "table": {
            .... table object
        }
    }
}
```

A typical `table` object response will include a `header` and `rows`. The `header` contains the column names, while the `rows` contain the row data.

Each row object consists of a `cells` array and an `entry` object. The `entry` is the label for the current row. While cells are the values for the corresponding columns of the row.

For more information on how to render this type of data refer to the [samples repository](https://github.com/AstronomyAPI/Samples)

```javascript
{
    "header": [
        "Column 1",
        "Column 2"
    ],
    "rows": [
        {
            "cells": [
                {
                    .. Row 1, Col 1
                },
                {
                    .. Row 1, Col 2
                }
            ],
            "entry": {
                "id": "Row 1"
            }
        },
        {
            "cells": [
                {
                    .. Row 2, Col 1
                },
                {
                    .. Row 2, Col 2
                }
            ],
            "entry": {
                "id": "Row 2"
            }
        },
        {
            "cells": [
                {
                    .. Row 3, Col 1
                },
                {
                    .. Row 3, Col 2
                }
            ],
            "entry": {
                "id": "Row 3"
            }
        }
    ]
}
```


# Rows Responses

Some endpoints return data as rows for easy rendering data as a list.

Certain API endpoints might return data as rows, so it's easier for you to render them in your template files.

You can get the `rows` array from the response object using `data.rows`.

```javascript
{
    "data": {
        "dates": {
            "from": "2016-12-20T00:00:00",
            "to": "2016-12-22T23:59:59"
        },
        "observer": {
            "location": {
                "longitude": -84.39733,
                "latitude": 33.775867,
                "elevation": 1000
            }
        },
        "rows": [
            .... rows
        ]
    }
}
```

Each object in the rows array can be accessed by iterating the array.

For more information on how to render this type of data refer to the [samples repository](https://github.com/AstronomyAPI/Samples)


# Error Responses

Common error responses.

Error response from the API should return a JSON object with the key `error` describing the nature of the error. A request validation failure will cause a `422` HTTP code to be produced.

### Sample validation error response

The below response was caused by not providing the value for the `latitude` parameter.

```javascript
 {
    "statusCode": 422,
    "errors": [
        {
            "path": [],
            "property": "instance",
            "message": "requires property \"latitude\"",
            "schema": {
                "latitude": {
                    "type": "string"
                },
                "longitude": {
                    "type": "string"
                },
                "elevation": {
                    "type": "string"
                },
                "from_date": {
                    "type": "string"
                },
                "to_date": {
                    "type": "string"
                },
                "time": {
                    "type": "string"
                },
                "required": [
                    "latitude",
                    "longitude",
                    "elevation",
                    "from_date",
                    "to_date",
                    "time"
                ]
            },
            "instance": {
                "elevation": "1000",
                "from_date": "2017-12-20",
                "longitude": "-84.39733",
                "time": "08:00:00",
                "to_date": "2017-12-27"
            },
            "name": "required",
            "argument": "latitude",
            "stack": "instance requires property \"latitude\""
        }
    ]
}
```


# Constellation Enums

| ID  | Short Name | Name                |
| --- | ---------- | ------------------- |
| and | And        | Andromeda           |
| leo | Leo        | Leo                 |
| ant | Ant        | Antlia              |
| lmi | LMi        | Leo Minor           |
| aps | Aps        | Apus                |
| lep | Lep        | Lepus               |
| aqr | Aqr        | Aquarius            |
| lib | Lib        | Libra               |
| aql | Aql        | Aquila              |
| lup | Lup        | Lupus               |
| ara | Ara        | Ara                 |
| lyn | Lyn        | Lynx                |
| ari | Ari        | Aries               |
| lyr | Lyr        | Lyra                |
| aur | Aur        | Auriga              |
| men | Men        | Mensa               |
| boo | Boo        | Boötes              |
| mic | Mic        | Microscopium        |
| cae | Cae        | Caelum              |
| mon | Mon        | Monoceros           |
| cam | Cam        | Camelopardalis      |
| mus | Mus        | Musca               |
| cnc | Cnc        | Cancer              |
| nor | Nor        | Norma               |
| cvn | Cvn        | Canes Venatici      |
| oct | Oct        | Octans              |
| cma | CMa        | Canis Major         |
| oph | Oph        | Ophiuchus           |
| cmi | CMi        | Canis Minor         |
| ori | Ori        | Orion               |
| cap | Cap        | Capricornus         |
| pav | Pav        | Pavo                |
| car | Car        | Carina              |
| peg | Peg        | Pegasus             |
| cas | Cas        | Cassiopeia          |
| per | Per        | Perseus             |
| cen | Cen        | Centaurus           |
| phe | Phe        | Phoenix             |
| cep | Cep        | Cepheus             |
| pic | Pic        | Pictor              |
| cet | Cet        | Cetus               |
| psc | Psc        | Pisces              |
| cha | Cha        | Chamaeleon          |
| psa | PsA        | Piscis Austrinus    |
| cir | Cir        | Circinus            |
| pup | Pup        | Puppis              |
| col | Col        | Columba             |
| pyx | Pyx        | Pyxis               |
| com | Com        | Coma Berenices      |
| ret | Ret        | Reticulum           |
| cra | CrA        | Corona Australis    |
| sge | Sge        | Sagitta             |
| crb | CrB        | Corona Borealis     |
| sgr | Sgr        | Sagittarius         |
| crv | Crv        | Corvus              |
| sco | Sco        | Scorpius            |
| crt | Crt        | Crater              |
| scl | Scl        | Sculptor            |
| cru | Cru        | Crux                |
| sct | Sct        | Scutum              |
| cyg | Cyg        | Cygnus              |
| ser | Ser        | Serpens             |
| del | Del        | Delphinus           |
| dor | Dor        | Dorado              |
| sex | Sex        | Sextans             |
| dra | Dra        | Draco               |
| tau | Tau        | Taurus              |
| equ | Equ        | Equuleus            |
| tel | Tel        | Telescopium         |
| eri | Eri        | Eridanus            |
| tri | Tri        | Triangulum          |
| for | For        | Fornax              |
| tra | TrA        | Triangulum Australe |
| gem | Gem        | Gemini              |
| tuc | Tuc        | Tucana              |
| gru | Gru        | Grus                |
| uma | UMa        | Ursa Major          |
| her | Her        | Hercules            |
| umi | UMi        | Ursa Minor          |
| hor | Hor        | Horologium          |
| vel | Vel        | Vela                |
| hya | Hya        | Hydra               |
| vir | Vir        | Virgo               |
| hyi | Hyi        | Hydrus              |
| vol | Vol        | Volans              |
| ind | Ind        | Indus               |
| vul | Vul        | Vulpecula           |
| lac | Lac        | Lacerta             |


# DSO Enums

| ID  | Name               |
| --- | ------------------ |
| G   | Galaxy             |
| DU  | Duplicate          |
| A   | Asterism           |
| STR | Star               |
| PNE | Planetary Nebula   |
| NF  | Not Found          |
| OC  | Open Cluster       |
| GC  | Globular Cluster   |
| PG  | Part of Galaxy     |
| SNR | Super Nova Remnant |
| SC  | Star Cloud         |


# Page


# Widgets

Embeddable scripts for your website

Need to integrate any of the studio endpoints on your website quickly? You might be looking for AstronomyAPI Widgets.

## Bare minimum

Widgets script can be loaded to your webpage by including a script tag inside the `<HEAD></HEAD>` tags, as shown below. Make sure to update the `yourEncryptedAuthString` with the base64 string you created as mentioned in the [authentication instructions](/#basic-authentication). Notice how the string should not include the term `Basic`.

{% code overflow="wrap" %}

```javascript
<html>
  <head>
    <title>My Website</title>
    <script src="https://widgets.astronomyapi.com/cdn/astronomy-api-widgets.js"></script>
  </head>
<body>
    <div id="moon-phase"></div>
    <div id="star-chart"></div>
    
    <script>
       document.addEventListener("DOMContentLoaded", function () {
        var client = new AstronomyAPI({
          basicToken: "yourEncryptedAuthString",
        });

        client.moonPhase();

        client.starChart();
      });
    </script>
  </body>
</html>
```

{% endcode %}

A \<DIV> tag is required to populate the widget. By default, the element id must be `moon-phase` or `star-chart`, depending on the type of widget you need.

A full list of examples could be found in the [examples folder on GitHub](https://github.com/AstronomyAPI/Widgets/tree/main/examples)

## Plugin API

The client instance is created using `new AstronomyAPI({...options})`. The parameter `basicToken` is required to initiate the class.

All methods follow the same payload body as the [moon phase](/endpoints/studio/moon-phase) or [star chart](/endpoints/studio/star-chart) API with an optional parameter `element` which can be used to attach a custom HTML element instead of the default element selector.

```
client.moonPhase({..options}, (response) => {})
client.starChart({..options}, (response) => {})
```

A callback function can be passed as the second parameter for each method. The callback function will be passed with the original response received from the API.

```javascript
  var client = new AstronomyAPI({
          basicToken: "yourEncryptedAuthString", // required
        });

        client.moonPhase(
          {
            element: "#moon-phase-element", // custom html element
            format: "png",
            style: {
              moonStyle: "sketch",
              backgroundStyle: "stars",
              backgroundColor: "red",
              headingColor: "white",
              textColor: "white",
            },
            observer: {
              latitude: 40.712772,
              longitude: -73.935242,
              date: "2020-10-28",
            },
            view: {
              type: "portrait-simple",
            },
          },
          (re) => { // callback function
            console.log("done", re);
          },
        );
      });
```

```javascript
var client = new AstronomyAPI({
          basicToken: "yourEncryptedAuthString",
        });

        client.starChart(
          {
            element: "#star-chart-element", // custom html element
            style: "navy",
            observer: {
              latitude: 12.775867,
              longitude: -23.39733,
              date: "2012-12-21",
            },
            view: {
              type: "constellation",
              parameters: {
                constellation: "ori",
              },
            },
          },
          (re) => { // callback function
            console.log("done", re);
          },
        );
      });
```


# Known Issues

This section describes known issues with the system

#### Endpoint timeout

You may experience endpoint timeouts (`HTTP 504`) - specifically in the studio endpoints. Retrying the request with the same request parameters will work.

#### Too many requests

Due to high resource consumption, you may experience too many requests (`HTTP 429`). Rate limiting is enforced on all consumers based on their IP and overall API consumption. Retrying after some time will resolve this error. If you require high API usage please send an email to <contact@astronomyapi.com>.

**Rapid API and rate limiting**

If you're authenticating with Rapid API you may receive a rate limit exceeded error. Simply get your own API key from the Astronomy API console instead of using the shared Rapid API key.

#### Coordinates are slightly different from other astronomical software

Astronomy API calculates coordinates based on the geolocation details you specify in the request. Due to the precision of the location and algorithm difference, the coordinates can be slightly different than what you would find in other astronomical software.

#### The moon is upside down on the moon phase generator endpoint

Depending on the hemisphere you live on earth, the side of the moon that's up might change. Use the `orientation` parameter in the request to change the direction. see [Moon Phase](/endpoints/studio/moon-phase) for details.


# Changelog

## 3.0.0 - 2023-11-05

### Add

* Events API

## 2.14.0 - 2023-03-20

### Update

* Infrastructure update
* Date range restriction of a maximum of 366 days added for positions endpoint.

## 2.13.2 - 2023-03-05

### Add

* Adding Studio Widgets

## 2.11.0 - 2022-12-31

### Add

* Update dependency packages
* Introducing demo.astronomyapi.com

## 2.10.0 - 2022-09-09

### Add

* Added search endpoint for searching objects

## 2.6.0 - 2022-06-14

### Add

* Added request metrics graphs in the dashboard

## 2.5.1 - 2021-11-23

### Update

* Update image processing libraries

## 2.5.0 - 2021-10-26

### Add

* Added support for moon phase orientation

## 2.4.0 -2021-09-09

### Improve

* System security update

## 2.3.0 - 2021-08-28

### Improve

* Improve performance for studio endpoints
* improve performance for positions endpoints

## 2.3.1 - 2020-11-06

### Fix

* Improved/ fixed date time validation and some other number validations.

## 2.3.0 - 2020-11-06

### Add

* Added moon phase generation

### Fix

* Fixed issue with time zone conversion
* Fixed issue with exception handling and reporting

## 2.2.0 - 2020-10-27

### Add

* Added star chart generation

## 2.1.1 - 2020-10-23

### Fix

* Fix bug in signup flow

## 2.0.1 - 2020-10-26

### Fix

* CORS behaviour fixed for browser users

## 2.0.0 - 2020-09-23

### Added

* Migrate API to v2
* New dashboard
* Go public on v2 API

## 1.1.1 - 2017-09-19

### Changed

* Changes to Docker file

## 1.1.0 - 2017-08-29

### Added

* Introduced rate limits

## 1.0.1 - 2017-08-15

### Fixed

* Issue with declination being wrong for certain scenarios

## 1.0.0 - 2017-08-13

### Added

* Introduced planetary positions api


