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

Yearly Hexagram

POST
/iching/yearly
request.sh
curl -X POST https://api.astroway.info/v1/iching/yearly \
-H "X-Api-Key: aw_live_..." \
-H "Content-Type: application/json" \
-d '{ "birthDate": "1990-06-15", "birthTime": "14:20", "timezoneOffset": 3, "year": 2027 }'

A hexagram for a person and a year: the Mei Hua formula with the earthly branch of the year asked about in place of the year of asking and the lunar month, day and hour of birth. Labelled basis: convention: Mei Hua casts for a question, and this annual use is this API’s convention. Returns the full Legge reading and ti/yong.

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
birthDate required
string
/^\d{4}-\d{2}-\d{2}$/
birthTime required

Birth time; gives the hour term of the cast.

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

Hours from UTC at the birthplace; places the lunar birth day. Defaults to 8.

number
0 nullable >= -14 <= 14
year required

The year the reading is for, by its earthly branch.

integer
>= 1900 <= 2200
Example
{
"birthDate": "1990-06-15",
"birthTime": "14:20",
"timezoneOffset": 3,
"year": 2027
}

Successful calculation

Media type application/json
object
ok
boolean
data
object
birthDate
string
nullable
year
number
nullable
lunarBirth
object
month
number
nullable
isLeapMonth
boolean
nullable
day
number
nullable
hourBranch
string
nullable
yearBranch
string
nullable
basis
string
nullable
method
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": {
"birthDate": "1990-06-15",
"year": 2027,
"lunarBirth": {
"month": 5,
"isLeapMonth": false,
"day": 23,
"hourBranch": "Wei"
},
"yearBranch": "Wei",
"basis": "convention",
"method": "The Mei Hua date formula with the branch of the year asked about in place of the year of asking, and the lunar month, day and hour of birth. A convention of this API, not a method of the Mei Hua Yi Shu, which casts for the moment of a question.",
"terms": {
"year": 8,
"month": 5,
"day": 23,
"hour": 8,
"upperSum": 36,
"lowerSum": 44,
"upperTrigramNumber": 4,
"lowerTrigramNumber": 4,
"movingLine": 2,
"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": 51,
"name": "The Arousing",
"pinyin": "Zhen",
"legge": "Kăn",
"chinese": "䷲",
"lines": [
1,
0,
0,
1,
0,
0
],
"lowerTrigram": 2,
"upperTrigram": 2,
"judgment": "Kăn gives the intimation of ease and development. When (the time of) movement (which it indicates) comes, (the subject of the hexagram) will be found looking out with apprehension, and yet smiling and talking cheerfully. When the movement (like a crash of thunder) terrifies all within a hundred lî, he will be (like the sincere worshipper) who is not (startled into) letting go his ladle and (cup of) sacrificial spirits."
},
"changingLines": [
{
"position": 2,
"text": "The second line, divided, shows its subject, when the movement approaches, in a position of peril. He judges it better to let go the articles (in his possession), and to ascend a very lofty height. There is no occasion for him to pursue after (the things he has let go); in seven days he will find them."
}
],
"resulting": {
"number": 54,
"name": "The Marrying Maiden",
"pinyin": "Gui Mei",
"legge": "Kwei Mei",
"chinese": "䷵",
"lines": [
1,
1,
0,
1,
0,
0
],
"lowerTrigram": 7,
"upperTrigram": 2,
"judgment": "Kwei Mei indicates that (under the conditions which it denotes) action will be evil, and in no wise advantageous."
},
"focus": {
"rule": "One changing line: read that line.",
"texts": [
{
"hexagram": 51,
"part": "line 2",
"text": "The second line, divided, shows its subject, when the movement approaches, in a position of peril. He judges it better to let go the articles (in his possession), and to ascend a very lofty height. There is no occasion for him to pursue after (the things he has let go); in seven days he will find them."
}
]
},
"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": 2,
"name": "Zhen (Thunder)",
"symbol": "☳",
"lines": [
1,
0,
0
],
"pinyin": "Zhen",
"chinese": "震",
"image": "thunder",
"attribute": "movement",
"family": "eldest son",
"animal": "dragon",
"bodyPart": "feet",
"earlierHeaven": {
"number": 4,
"direction": "northeast"
},
"laterHeaven": {
"number": 3,
"direction": "east"
},
"phase": "wood"
},
"yong": {
"index": 2,
"name": "Zhen (Thunder)",
"symbol": "☳",
"lines": [
1,
0,
0
],
"pinyin": "Zhen",
"chinese": "震",
"image": "thunder",
"attribute": "movement",
"family": "eldest son",
"animal": "dragon",
"bodyPart": "feet",
"earlierHeaven": {
"number": 4,
"direction": "northeast"
},
"laterHeaven": {
"number": 3,
"direction": "east"
},
"phase": "wood"
},
"relation": "same",
"verdict": "Ti and yong share a phase: favourable, the two agree."
},
"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"
}
}