🌒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
Generate Moon Phase
POST
https://api.astronomyapi.com/api/v2/studio/moon-phase
Headers
Name | Type | Description |
---|---|---|
Authorization* | string | Basic <hash> |
Request Body
Name | Type | Description |
---|---|---|
format | string | Image format to be returned. Valid values are |
style | object | Style object contains the styling parameters for the image generated. |
observer* | object | Observer object must contain the |
view* | object | View object is used to configure the view of the rendered image. The view object must contain a
|
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
moonStyle
Valid values are default
, sketch
and shaded.
Below are sample moons for each value.
backgroundStyle
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
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.
View
type
type
The type parameter in the view object should specify which template to be used when rendering the image. Currently two templates are available.
orientation
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.
Last updated