Skip to main content
GET 

/astronomy/point

Astronomy Point

Use the astronomy endpoint to retrieve global astronomical data including sunrise/sunset and moon data for a specific location.

Query Parameters​

These are the available query parameters for this endpoint. Required parameters are pre-checked and must be included. Tick any additional parameters to update the sample request and code snippets.

lat- Latitude in decimal degrees
[-90, 90]
lng- Longitude in decimal degrees
[-180, 180]
start- Timestamp in UTC for the first hour to include in the forecast
end- Timestamp in UTC for the last hour to include in the forecast

Response​

The response contains a data array. Each item has the following fields.

astronomicalDawn- Timestamp in UTC for when the sun is below 18°. Will return null if no dawn occurs on the given day
astronomicalDusk- Timestamp in UTC for when the sun is above 18°. Will return null if no dusk occurs on the given day
civilDawn- Timestamp for sunset (sun is below 6°) given in UTC. Will return null if no dawn occurs on the given day
civilDusk- Timestamp for sunrise (sun is above 6°) in UTC. Will return null if no dusk occurs on the given day
moonFraction- A float number between 0 and 1 indicating how much of the moon is illuminated
moonPhase- An object that holds the current moon phase and the closest of the four main phases
moonPhase.closest- The closest of the four main moon phases (new moon, first quarter, full moon or third quarter), either just passed or coming up.
moonPhase.closest.text- Name of the closest main phase, i.e New moon (0), First quarter (0.25), Full moon (0.5) or Third Quarter (0.75).
moonPhase.closest.time- Timestamp in UTC for when the closest main phase occurs.
moonPhase.closest.value- Phase value of the closest main phase. 0 is new moon, 0.25 first quarter, 0.5 full moon and 0.75 third quarter.
moonPhase.current- The moon phase at the start of the requested day.
moonPhase.current.text- Name of the current phase, for example Waxing crescent or Waning gibbous.
moonPhase.current.time- Timestamp in UTC that the current phase refers to.
moonPhase.current.value- Phase value from 0 to 1, where 0 is new moon, 0.5 full moon and values approaching 1 a waning crescent.
moonrise- Timestamp for moonrise in UTC. Will return null if no moonrise occurs on the given day
moonset- Timestamp for moonset in UTC. Will return null if no moonset occurs on the given day
nauticalDawn- Timestamp for nautical dawn (sun is below 12°) in UTC. Will return null if no dawn occurs on the given day
nauticalDusk- Timestamp for nautical dusk (sun is above 12°) in UTC. Will return null if no dusk occurs on the given day
sunrise- Timestamp for sunrise in UTC. Will return null if no sunrise occurs on the given day
sunset- Timestamp for sunset in UTC. Will return null if no sunset occurs on the given day
time- Timestamp in UTC indicating the day for the data

Response Meta​

As part of the response, you will find an object called meta with the following content.

lat
[-90, 90]
lng
[-180, 180]
start- The first timestamp of data returned
end- The last timestamp of data returned
dailyQuota- The number of requests you are allowed to make each day
requestCount- The number of successful requests you have made since 00:00 UTC

Responses​

Astronomy data

Reference (plain text)

GET /astronomy/point — Astronomy Point

Parameters​

NameInTypeRequiredDescription
latquerynumberyesLatitude in decimal degrees
lngquerynumberyesLongitude in decimal degrees
startquerystringnoTimestamp in UTC for the first hour to include in the forecast
endquerystringnoTimestamp in UTC for the last hour to include in the forecast

Responses​

200 — Astronomy data

application/json

FieldTypeRequiredDescription
dataobject(astronomicalDawn: string, astronomicalDusk: string, civilDawn: string, …)[]no
metaobject(lat: number, lng: number, start: string, …)no

402 — Error: Payment required (quota exceeded)

application/json

FieldTypeRequiredDescription
errorsobject(key: string)no
metaobject(dailyQuota: number, requestCount: number)no

403 — Forbidden

application/json

FieldTypeRequiredDescription
errorsobject(key: string)no

422 — Error: Unprocessable Entity

application/json

FieldTypeRequiredDescription
errorsobject(key: string)no

Response​

FieldTypeRequiredDescription
astronomicalDawnstringnoTimestamp in UTC for when the sun is below 18°. Will return null if no dawn occurs on the given day
astronomicalDuskstringnoTimestamp in UTC for when the sun is above 18°. Will return null if no dusk occurs on the given day
civilDawnstringnoTimestamp for sunset (sun is below 6°) given in UTC. Will return null if no dawn occurs on the given day
civilDuskstringnoTimestamp for sunrise (sun is above 6°) in UTC. Will return null if no dusk occurs on the given day
moonFractionobject<string, number>noA float number between 0 and 1 indicating how much of the moon is illuminated
moonPhaseobject(closest: object(text: string, time: string, value: object), current: object(text: string, time: string, value: object))noAn object that holds the current moon phase and the closest of the four main phases
moonrisestringnoTimestamp for moonrise in UTC. Will return null if no moonrise occurs on the given day
moonsetstringnoTimestamp for moonset in UTC. Will return null if no moonset occurs on the given day
nauticalDawnstringnoTimestamp for nautical dawn (sun is below 12°) in UTC. Will return null if no dawn occurs on the given day
nauticalDuskstringnoTimestamp for nautical dusk (sun is above 12°) in UTC. Will return null if no dusk occurs on the given day
sunrisestringnoTimestamp for sunrise in UTC. Will return null if no sunrise occurs on the given day
sunsetstringnoTimestamp for sunset in UTC. Will return null if no sunset occurs on the given day
timestringnoTimestamp in UTC indicating the day for the data

Response Meta​

FieldTypeRequiredDescription
latnumberno
lngnumberno
startstringnoThe first timestamp of data returned
endstringnoThe last timestamp of data returned
dailyQuotanumbernoThe number of requests you are allowed to make each day
requestCountnumbernoThe number of successful requests you have made since 00:00 UTC