Full Chart (computed)
POST
/ziwei/chart
curl -X POST https://api.astroway.info/v1/ziwei/chart \ -H "X-Api-Key: aw_live_..." \ -H "Content-Type: application/json" \ -d '{ "date": "2000-08-16", "time": "04:00:00", "gender": "male" }'const res = await fetch('https://api.astroway.info/v1/ziwei/chart', { method: 'POST', headers: { 'X-Api-Key': process.env.ASTROWAY_API_KEY, 'Content-Type': 'application/json', }, body: JSON.stringify({ "date": "2000-08-16", "time": "04:00:00", "gender": "male" }),});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/ziwei/chart', headers={'X-Api-Key': os.environ['ASTROWAY_API_KEY'], 'Content-Type': 'application/json'}, json={ 'date': "2000-08-16", 'time': "04:00:00", 'gender': "male" },)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('ziwei/chart', [ 'headers' => ['X-Api-Key' => getenv('ASTROWAY_API_KEY')], 'json' => [ 'date' => '2000-08-16', 'time' => '04:00:00', 'gender' => 'male', ],]);$result = json_decode($r->getBody(), true);if (!$result['ok']) throw new \RuntimeException($result['error']['message']);print_r($result['data']);Real star placement: soul and body palaces, the five-element class, all 14 main stars plus auxiliaries, the twelve stages, the 12 decade limits and the 四化 marked on the stars that carry them.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
date required
string
time required
string
timezoneOffset
number
gender required
string
school
string
yearDivide
string
fixLeap
boolean
dayDivide
string
tianmaSchool
string
age
integer
language
string
Example
{ "date": "2000-08-16", "time": "04:00:00", "gender": "male"}Responses
Section titled “ Responses ”Successful calculation
Media type application/json
object
ok
boolean
data
object
lunar
object
month
number
isLeapMonth
boolean
day
number
monthStart
string
fiveElementClass
object
key
string
chinese
string
value
number
soulPalace
object
index
number
branch
string
ziwei
object
index
number
branch
string
palaces
Array<object>
object
branch
string
palace
string
pillar
string
majorStars
Array<object>
object
chinese
string
name
string
lifeStage
object
chinese
string
name
string
decade
object
index
number
fromAge
number
toAge
number
computed
boolean
Example
{ "ok": true, "data": { "lunar": { "month": 7, "isLeapMonth": false, "day": 17, "monthStart": "2000-07-31" }, "fiveElementClass": { "key": "wood3", "chinese": "木三局", "value": 3 }, "soulPalace": { "index": 4, "branch": "Wu" }, "ziwei": { "index": 4, "branch": "Wu" }, "palaces": [ { "branch": "Wu", "palace": "destiny", "pillar": "Ren-Wu", "majorStars": [ { "chinese": "紫微", "name": "Purple Star" } ], "lifeStage": { "chinese": "死", "name": "Death" }, "decade": { "index": 0, "fromAge": 3, "toAge": 12 } } ], "computed": true }}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" }} Корисно?
Дякуємо за фідбек.