Skip to content

Latest commit

 

History

History
113 lines (86 loc) · 3.53 KB

File metadata and controls

113 lines (86 loc) · 3.53 KB
description Generates a star chart with the given parameters, and returns the url.

✨ Star Chart

If you're looking to quickly integrate this feature on your website without making API calls, checkout Widgets

{% swagger baseUrl="https://api.astronomyapi.com" path="/api/v2/studio/star-chart" method="post" summary="Generate star chart" expanded="true" %} {% swagger-description %}

{% endswagger-description %}

{% swagger-parameter in="header" name="Authorization" type="string" required="true" %} Basic <hash> {% endswagger-parameter %}

{% swagger-parameter in="body" name="style" type="string" required="false" %} 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. {% endswagger-parameter %}

{% swagger-parameter in="body" name="observer" type="object" required="true" %} Observer object must contain the latitude, longitude and date of the observer. {% endswagger-parameter %}

{% swagger-parameter in="body" name="view" type="object" required="true" %} 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. {% endswagger-parameter %}

{% swagger-response status="200: OK" description="" %}

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

{% endswagger-response %} {% endswagger %}

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

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

{
    "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.

// 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

inverted

navy

red