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

Gregorian to Lunar Date

POST
/chinese/lunar-date
request.sh
curl -X POST https://api.astroway.info/v1/chinese/lunar-date \
-H "X-Api-Key: aw_live_..." \
-H "Content-Type: application/json" \
-d '{ "date": "2023-03-25" }'

Chinese lunar month and day for a Gregorian date, including leap-month detection, plus the Chinese New Year of that year.

Media type application/json
object
Example
{
"date": "2023-03-25"
}

Successful calculation

Media type application/json
object
ok
boolean
data
object
gregorianDate
string
nullable
lunar
object
month
number
nullable
isLeapMonth
boolean
nullable
day
number
nullable
monthStart
string
nullable
label
string
nullable
chineseNewYear
string
nullable
Example
{
"ok": true,
"data": {
"gregorianDate": "2023-03-25",
"lunar": {
"month": 2,
"isLeapMonth": true,
"day": 4,
"monthStart": "2023-03-22",
"label": "leap month 2, day 4"
},
"chineseNewYear": "2023-01-22"
}
}

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"
}
}
Корисно?