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

Plum Blossom (Mei Hua) Cast

POST
/iching/plum-blossom
request.sh
curl -X POST https://api.astroway.info/v1/iching/plum-blossom \
-H "X-Api-Key: aw_live_..." \
-H "Content-Type: application/json" \
-d '{ "date": "2026-11-07", "time": "10:30", "timezoneOffset": 2 }'

Casts a hexagram from the moment of the question by the Mei Hua Yi Shu method: Chinese lunar year branch, lunar month and day (from the ephemeris, Beijing days) and the hour branch give the upper trigram, the lower trigram and one moving line; the response shows every term and sum, the Legge reading, and ti and yong (the asker and the matter) with their five-phase verdict.

fields
string

Comma-separated dotted paths, relative to data, to keep in the response. A path is applied to every element of an array, so planets.name means the name of each planet. Paths that match nothing come back in _fields_unmatched; a list where nothing matches at all is a 400, because an empty object would be a confident wrong answer.

Example
planets.name,planets.longitude
precision
integer
<= 15

Round every non-integer number in the response to this many decimal places. Integers are left alone, because an id is not a measurement. Ecliptic longitudes ship with fourteen decimals by default; 2 is about a tenth of an arcminute.

Example
4
Idempotency-Key
string
>= 1 characters <= 255 characters /^[\x21-\x7E]+$/

Unique per logical operation, kept across retries. For 24 hours from the first request, a repeat with the same key, method, path, body and query string returns the stored response with Idempotent-Replayed: true and costs 0 credits. The same key with a different body or query string is a 409 IDEMPOTENCY_KEY_REUSED; a repeat while the first is still running is a 409 IDEMPOTENCY_IN_PROGRESS. Only 2xx responses are kept. See /idempotency/.

Example
01HXY2A7ZM0ABCDEF
Media type application/json
object
date required

Date of the question, YYYY-MM-DD.

string
/^\d{4}-\d{2}-\d{2}$/
time required

Clock time of the question, HH:mm or HH:mm:ss; gives the hour branch.

string
/^\d{2}:\d{2}(:\d{2})?$/
timezoneOffset

Hours from UTC at the place of the question; places the lunar day. Defaults to 8, China Standard Time. Ignored when timezone is sent.

number
0 nullable >= -14 <= 14
timezone

IANA zone name such as Europe/Kyiv, or auto to look the zone up from latitude and longitude. The server takes the offset that zone kept at this local date and time, summer time included, and uses it in place of timezoneOffset. A clock time that happened twice takes the first occurrence; one skipped when clocks went forward takes the offset from before the change. Abbreviations such as EST are refused. Before 1970 the tz database is not reliable for every place, so send timezoneOffset when the local clock is known.

string
Example
{
"date": "2026-11-07",
"time": "10:30",
"timezoneOffset": 2
}

Successful calculation

Media type application/json
object
ok
boolean
data
object
date
string
nullable
time
string
nullable
lunarDate
object
year
number
nullable
yearBranch
string
nullable
month
number
nullable
isLeapMonth
boolean
nullable
day
number
nullable
hourBranch
string
nullable
terms
object
year
number
nullable
month
number
nullable
day
number
nullable
hour
number
nullable
upperSum
number
nullable
lowerSum
number
nullable
upperTrigramNumber
number
nullable
lowerTrigramNumber
number
nullable
movingLine
number
nullable
rule
string
nullable
lines
Array<object>
nullable
object
position
number
nullable
value
number
nullable
yang
boolean
nullable
changing
boolean
nullable
primary
object
number
number
nullable
name
string
nullable
pinyin
string
nullable
legge
string
nullable
chinese
string
nullable
lines
Array<number>
nullable
lowerTrigram
number
nullable
upperTrigram
number
nullable
judgment
string
nullable
changingLines
Array<object>
nullable
object
position
number
nullable
text
string
nullable
resulting
object
number
number
nullable
name
string
nullable
pinyin
string
nullable
legge
string
nullable
chinese
string
nullable
lines
Array<number>
nullable
lowerTrigram
number
nullable
upperTrigram
number
nullable
judgment
string
nullable
focus
object
rule
string
nullable
texts
Array<object>
nullable
object
hexagram
number
nullable
part
string
nullable
text
string
nullable
source
string
nullable
readingRuleSource
string
nullable
tiYong
object
ti
object
index
number
nullable
name
string
nullable
symbol
string
nullable
lines
Array<number>
nullable
pinyin
string
nullable
chinese
string
nullable
image
string
nullable
attribute
string
nullable
family
string
nullable
animal
string
nullable
bodyPart
string
nullable
earlierHeaven
object
number
number
nullable
direction
string
nullable
laterHeaven
object
number
number
nullable
direction
string
nullable
phase
string
nullable
yong
object
index
number
nullable
name
string
nullable
symbol
string
nullable
lines
Array<number>
nullable
pinyin
string
nullable
chinese
string
nullable
image
string
nullable
attribute
string
nullable
family
string
nullable
animal
string
nullable
bodyPart
string
nullable
earlierHeaven
object
number
number
nullable
direction
string
nullable
laterHeaven
object
number
number
nullable
direction
string
nullable
phase
string
nullable
relation
string
nullable
verdict
string
nullable
meiHuaSource
string
nullable
Example
{
"ok": true,
"data": {
"date": "2026-11-07",
"time": "10:30",
"lunarDate": {
"year": 2026,
"yearBranch": "Wu",
"month": 9,
"isLeapMonth": false,
"day": 29,
"hourBranch": "Si"
},
"terms": {
"year": 7,
"month": 9,
"day": 29,
"hour": 6,
"upperSum": 45,
"lowerSum": 51,
"upperTrigramNumber": 5,
"lowerTrigramNumber": 3,
"movingLine": 3,
"rule": "Upper trigram: (year + month + day) mod 8; lower: (year + month + day + hour) mod 8; moving line: the same sum mod 6; a remainder of 0 counts as 8 or 6. Trigrams are numbered in the Earlier Heaven order (1 Qian, 2 Dui, 3 Li, 4 Zhen, 5 Xun, 6 Kan, 7 Gen, 8 Kun)."
},
"lines": [
{
"position": 1,
"value": 7,
"yang": true,
"changing": false
}
],
"primary": {
"number": 37,
"name": "The Family",
"pinyin": "Jia Ren",
"legge": "Kiâ Zăn",
"chinese": "䷤",
"lines": [
1,
0,
1,
0,
1,
1
],
"lowerTrigram": 6,
"upperTrigram": 5,
"judgment": "For (the realisation of what is taught in) Kiâ Zăn, (or for the regulation of the family), what is most advantageous is that the wife be firm and correct."
},
"changingLines": [
{
"position": 3,
"text": "The third line, undivided, shows its subject (treating) the members of the household with stern severity. There will be occasion for repentance, there will be peril, (but) there will (also) be good fortune. If the wife and children were to be smirking and chattering, in the end there would be occasion for regret."
}
],
"resulting": {
"number": 42,
"name": "Increase",
"pinyin": "Yi",
"legge": "Yî",
"chinese": "䷩",
"lines": [
1,
0,
0,
0,
1,
1
],
"lowerTrigram": 2,
"upperTrigram": 5,
"judgment": "Yî indicates that (in the state which it denotes) there will be advantage in every movement which shall be undertaken, that it will be advantageous (even) to cross the great stream."
},
"focus": {
"rule": "One changing line: read that line.",
"texts": [
{
"hexagram": 37,
"part": "line 3",
"text": "The third line, undivided, shows its subject (treating) the members of the household with stern severity. There will be occasion for repentance, there will be peril, (but) there will (also) be good fortune. If the wife and children were to be smirking and chattering, in the end there would be occasion for regret."
}
]
},
"source": "James Legge, The Yi King, Sacred Books of the East vol. XVI (1882; 2nd ed. 1899), public domain: the Text (judgments and line statements)",
"readingRuleSource": "Zhu Xi, Yixue Qimeng (1186), ch. 4, on reading changing lines",
"tiYong": {
"ti": {
"index": 5,
"name": "Xun (Wind)",
"symbol": "☴",
"lines": [
0,
1,
1
],
"pinyin": "Xun",
"chinese": "巽",
"image": "wind, wood",
"attribute": "penetration",
"family": "eldest daughter",
"animal": "fowl",
"bodyPart": "thighs",
"earlierHeaven": {
"number": 5,
"direction": "southwest"
},
"laterHeaven": {
"number": 4,
"direction": "southeast"
},
"phase": "wood"
},
"yong": {
"index": 6,
"name": "Li (Fire)",
"symbol": "☲",
"lines": [
1,
0,
1
],
"pinyin": "Li",
"chinese": "離",
"image": "fire, the sun",
"attribute": "brightness",
"family": "middle daughter",
"animal": "pheasant",
"bodyPart": "eyes",
"earlierHeaven": {
"number": 3,
"direction": "east"
},
"laterHeaven": {
"number": 9,
"direction": "south"
},
"phase": "fire"
},
"relation": "generated-by",
"verdict": "Ti generates yong: draining, the asker gives more than returns."
},
"meiHuaSource": "Mei Hua Yi Shu (attributed to Shao Yong, 11th c.), casting by year, month, day and hour; ti and yong by the five phases"
}
}

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"
}
}