Skip to content
AstroWay/api v2.325.0 · docs
all systems operational

The Eight Trigrams

GET
/iching/trigrams
request.sh
curl -X GET https://api.astroway.info/v1/iching/trigrams \
-H "X-Api-Key: aw_live_..." \
-H "Content-Type: application/json"

All eight trigrams (bagua) with lines, image, attribute, family member, animal and body part from the Shuo Gua, Earlier and Later Heaven numbers and directions, and the five-phase element.

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

Successful calculation

Media type application/json
object
ok
boolean
data
object
count
number
nullable
trigrams
Array<object>
nullable
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
source
string
nullable
Example
{
"ok": true,
"data": {
"count": 8,
"trigrams": [
{
"index": 0,
"name": "Qian (Heaven)",
"symbol": "☰",
"lines": [
1,
1,
1
],
"pinyin": "Qian",
"chinese": "乾",
"image": "heaven",
"attribute": "strength",
"family": "father",
"animal": "horse",
"bodyPart": "head",
"earlierHeaven": {
"number": 1,
"direction": "south"
},
"laterHeaven": {
"number": 6,
"direction": "northwest"
},
"phase": "metal"
}
],
"source": "Shuo Gua ch. 4-11 (Legge, Sacred Books of the East vol. XVI, Appendix V, 1882, public domain) for image, attribute, family, animal and body part; Fu Xi (Earlier Heaven) and King Wen (Later Heaven) arrangements for numbers and directions; Han-era five-phase correspondence."
}
}

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