Hidden stems (Cang Gan)
POST
/bazi/hidden-stems
curl -X POST https://api.astroway.info/v1/bazi/hidden-stems \ -H "X-Api-Key: aw_live_..." \ -H "Content-Type: application/json" \ -d '{ "date": "1990-05-15", "time": "14:30:00", "timezoneOffset": 8 }'const res = await fetch('https://api.astroway.info/v1/bazi/hidden-stems', { method: 'POST', headers: { 'X-Api-Key': process.env.ASTROWAY_API_KEY, 'Content-Type': 'application/json', }, body: JSON.stringify({ "date": "1990-05-15", "time": "14:30:00", "timezoneOffset": 8 }),});const { ok, data, error } = await res.json();if (!ok) throw new Error(error.message);console.log(data);import os, requests
r = requests.post( 'https://api.astroway.info/v1/bazi/hidden-stems', headers={'X-Api-Key': os.environ['ASTROWAY_API_KEY'], 'Content-Type': 'application/json'}, json={ 'date': "1990-05-15", 'time': "14:30:00", 'timezoneOffset': 8 },)result = r.json()if not result['ok']: raise RuntimeError(result['error']['message'])print(result['data'])<?phpuse GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://api.astroway.info/v1/']);$r = $client->post('bazi/hidden-stems', [ 'headers' => ['X-Api-Key' => getenv('ASTROWAY_API_KEY')], 'json' => [ 'date' => '1990-05-15', 'time' => '14:30:00', 'timezoneOffset' => 8, ],]);$result = json_decode($r->getBody(), true);if (!$result['ok']) throw new \RuntimeException($result['error']['message']);print_r($result['data']);The one to three stems each branch shelters, with role and weight. This is where most of a chart’s elements live: a chart with no visible Water can still be soaked in it. On the four storage branches the middle role belongs to the stored element, not to the second in the list.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
date required
string
time
string
timezoneOffset
number
longitude
number
trueSolarTime
boolean
stageSchool
string
includeFullTable
boolean
language
string
Example
{ "date": "1990-05-15", "time": "14:30:00", "timezoneOffset": 8}Responses
Section titled “ Responses ”Successful calculation
Media type application/json
object
ok
boolean
data
object
solarYear
number
pillars
Array<object>
object
name
string
stem
string
branch
string
pillar
string
hiddenStems
Array<object>
object
stem
string
stemIndex
number
element
string
yin
boolean
role
string
weight
number
elementName
string
polarity
string
weighting
string
notes
Array
methodology
string
source
string
disclaimer
string
Example
{ "ok": true, "data": { "solarYear": 1990, "pillars": [ { "name": "year", "stem": "Geng", "branch": "Wu", "pillar": "Geng-Wu", "hiddenStems": [ { "stem": "Ding", "stemIndex": 3, "element": "Fire", "yin": true, "role": "principal", "weight": 0.7, "elementName": "Вогонь", "polarity": "Інь" }, { "stem": "Ji", "stemIndex": 5, "element": "Earth", "yin": true, "role": "middle", "weight": 0.3, "elementName": "Земля", "polarity": "Інь" } ] }, { "name": "month", "stem": "Xin", "branch": "Si", "pillar": "Xin-Si", "hiddenStems": [ { "stem": "Bing", "stemIndex": 2, "element": "Fire", "yin": false, "role": "principal", "weight": 0.6, "elementName": "Вогонь", "polarity": "Ян" }, { "stem": "Geng", "stemIndex": 6, "element": "Metal", "yin": false, "role": "middle", "weight": 0.3, "elementName": "Метал", "polarity": "Ян" }, { "stem": "Wu", "stemIndex": 4, "element": "Earth", "yin": false, "role": "residual", "weight": 0.1, "elementName": "Земля", "polarity": "Ян" } ] }, { "name": "day", "stem": "Geng", "branch": "Chen", "pillar": "Geng-Chen", "hiddenStems": [ { "stem": "Wu", "stemIndex": 4, "element": "Earth", "yin": false, "role": "principal", "weight": 0.6, "elementName": "Земля", "polarity": "Ян" }, { "stem": "Yi", "stemIndex": 1, "element": "Wood", "yin": true, "role": "residual", "weight": 0.3, "elementName": "Дерево", "polarity": "Інь" }, { "stem": "Gui", "stemIndex": 9, "element": "Water", "yin": true, "role": "middle", "weight": 0.1, "elementName": "Вода", "polarity": "Інь" } ] }, { "name": "hour", "stem": "Gui", "branch": "Wei", "pillar": "Gui-Wei", "hiddenStems": [ { "stem": "Ji", "stemIndex": 5, "element": "Earth", "yin": true, "role": "principal", "weight": 0.6, "elementName": "Земля", "polarity": "Інь" }, { "stem": "Ding", "stemIndex": 3, "element": "Fire", "yin": true, "role": "residual", "weight": 0.3, "elementName": "Вогонь", "polarity": "Інь" }, { "stem": "Yi", "stemIndex": 1, "element": "Wood", "yin": true, "role": "middle", "weight": 0.1, "elementName": "Дерево", "polarity": "Інь" } ] } ], "weighting": "Each branch contributes one character split among the stems it shelters: 1.0 alone, 0.7/0.3 for two, 0.6/0.3/0.1 for three (本气/中气/余气). The membership is canonical; the split is a stated convention, and the day-count 人元司令 scheme distributes the same characters differently.", "notes": [], "methodology": "地支藏干. Each branch shelters one to three stems: 本气 the principal, 中气 the middle, 余气 the residual. A chart with no visible Water can still be soaked in it, which is why an element count over the eight visible characters alone is not a balance.", "source": "淵海子平 (Song) + 三命通會 (Wan Minying, Ming), public domain", "disclaimer": "BaZi pillars use the canonical 60-jiazi cycle, anchored at 1990-01-01 = Bing-Yin. Year and month boundaries are the exact Lichun and 節 instants from the ephemeris, stated in China Standard Time; pass time and timezoneOffset for births near a boundary. Day and hour follow the birthplace clock, with the day rolling at 23:00 local." }}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" }} Корисно?
Дякуємо за фідбек.