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.
Response
The response contains a data array. Each item has the following fields.
Response Meta
As part of the response, you will find an object called meta with the following content.
Responses
- 200
- 402
- 403
- 422
Astronomy data
Error: Payment required (quota exceeded)
Forbidden
Error: Unprocessable Entity
Reference (plain text)
GET /astronomy/point — Astronomy Point
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
lat | query | number | yes | Latitude in decimal degrees |
lng | query | number | yes | Longitude in decimal degrees |
start | query | string | no | Timestamp in UTC for the first hour to include in the forecast |
end | query | string | no | Timestamp in UTC for the last hour to include in the forecast |
Responses
200 — Astronomy data
application/json
| Field | Type | Required | Description |
|---|---|---|---|
data | object(astronomicalDawn: string, astronomicalDusk: string, civilDawn: string, …)[] | no | |
meta | object(lat: number, lng: number, start: string, …) | no |
402 — Error: Payment required (quota exceeded)
application/json
| Field | Type | Required | Description |
|---|---|---|---|
errors | object(key: string) | no | |
meta | object(dailyQuota: number, requestCount: number) | no |
403 — Forbidden
application/json
| Field | Type | Required | Description |
|---|---|---|---|
errors | object(key: string) | no |
422 — Error: Unprocessable Entity
application/json
| Field | Type | Required | Description |
|---|---|---|---|
errors | object(key: string) | no |
Response
| Field | Type | Required | Description |
|---|---|---|---|
astronomicalDawn | string | no | Timestamp in UTC for when the sun is below 18°. Will return null if no dawn occurs on the given day |
astronomicalDusk | string | no | Timestamp in UTC for when the sun is above 18°. Will return null if no dusk occurs on the given day |
civilDawn | string | no | Timestamp for sunset (sun is below 6°) given in UTC. Will return null if no dawn occurs on the given day |
civilDusk | string | no | Timestamp for sunrise (sun is above 6°) in UTC. Will return null if no dusk occurs on the given day |
moonFraction | object<string, number> | no | A float number between 0 and 1 indicating how much of the moon is illuminated |
moonPhase | object(closest: object(text: string, time: string, value: object), current: object(text: string, time: string, value: object)) | no | An object that holds the current moon phase and the closest of the four main phases |
moonrise | string | no | Timestamp for moonrise in UTC. Will return null if no moonrise occurs on the given day |
moonset | string | no | Timestamp for moonset in UTC. Will return null if no moonset occurs on the given day |
nauticalDawn | string | no | Timestamp for nautical dawn (sun is below 12°) in UTC. Will return null if no dawn occurs on the given day |
nauticalDusk | string | no | Timestamp for nautical dusk (sun is above 12°) in UTC. Will return null if no dusk occurs on the given day |
sunrise | string | no | Timestamp for sunrise in UTC. Will return null if no sunrise occurs on the given day |
sunset | string | no | Timestamp for sunset in UTC. Will return null if no sunset occurs on the given day |
time | string | no | Timestamp in UTC indicating the day for the data |
Response Meta
| Field | Type | Required | Description |
|---|---|---|---|
lat | number | no | |
lng | number | no | |
start | string | no | The first timestamp of data returned |
end | string | no | The last timestamp of data returned |
dailyQuota | number | no | The number of requests you are allowed to make each day |
requestCount | number | no | The number of successful requests you have made since 00:00 UTC |