Перейти до вмісту
AstroWay/api v2.73.0 · docs
усі системи в нормі

Eclipses

POST
/eclipses
request.sh
curl -X POST https://api.astroway.info/v1/eclipses \
-H "X-Api-Key: aw_live_..." \
-H "Content-Type: application/json" \
-d '{ "year": 2024, "yearsRange": 2 }'

Find solar and lunar eclipses within a given year or multi-year range. Returns type, date, and geographic visibility data.

Media type application/json
object
year required
number
nullable
yearsRange
number
nullable
Example
{
"year": 2024,
"yearsRange": 2
}

Successful calculation

Media type application/json
object
ok
boolean
data
object
eclipses
Array<object>
object
type
string
subtype
string
date
string
jd
number
saros
number
longitude
number
Example
{
"ok": true
}

Validation error

Media type application/json
Example
{
"ok": false,
"error": {
"code": "INVALID_INPUT",
"message": "Validation failed: date: Date must be YYYY-MM-DD",
"details": [
{
"path": "date",
"message": "Date must be YYYY-MM-DD"
}
]
}
}

Missing or invalid API key

Media type application/json
Example
{
"ok": false,
"error": {
"code": "INVALID_API_KEY",
"message": "Invalid API key"
}
}
Корисно?