AstroWay/api v2.173.1 · pl
wszystkie systemy w normie
// astrology api · POST /v1/ziwei/chart

Zi Wei Dou Shu (Purple Star) API

A birth date, a time and a sex produce the whole chart: twelve palaces with their stems, all fourteen main stars, the auxiliaries, thirty-one minor stars, the twelve life stages, the decade limits and the four transformations marked on the stars that carry them.

Endpoint
POST /v1/ziwei/chart
Koszt
20 kredytów
Opóźnienie
~130 ms
Poziom
Tier 2
// 01 / Co oblicza

Zi Wei Dou Shu (Purple Star) API

The birth is converted to a lunar date, because Zi Wei is a purely lunar system and, unlike BaZi, does not switch to the solar terms. From the lunar month and the double-hour the endpoint places the soul palace and the body palace, then stems every palace by the five-tigers rule, then reads the five-element class off the soul palace pillar. That class and the lunar day place 紫微 by the classical borrow-and-divide rule, the six stars of its series follow by fixed offsets, 天府 mirrors it across the 寅-申 axis and carries its own eight. On top of that skeleton go the six lucky and six malefic stars, the salary store and the heavenly horse, thirty-one minor stars keyed variously to the year stem, the year branch, the month, the day and the hour, the twelve life stages, the scholar cycle, the general cycle and the year cycle, the ten-year limits opening at the class number, and the annual limit if you ask for an age. The four transformations are resolved from the year stem and attached to the stars themselves rather than returned as a detached list.

// 02 / Zapytanie na żywo

POST/v1/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",
    "age": 25
  }'
Odpowiedź (fragment)
{
  "ok": true,
  "data": {
    "fiveElementClass": { "key": "wood3", "chinese": "木三局", "name": "Wood 3", "value": 3 },
    "soulPalace": { "index": 4, "branch": "Wu" },
    "bodyPalace": { "index": 8, "branch": "Xu" },
    "ziwei": { "index": 4, "branch": "Wu" },
    "annualLimit": { "age": 25, "index": 8, "branch": "Xu" },
    "palaces": [
      {
        "branch": "Wu",
        "pillar": "Ren-Wu",
        "palace": "destiny",
        "isSoul": true,
        "majorStars": [{ "chinese": "紫微", "name": "Purple Star", "pinyin": "Zi Wei" }],
        "lifeStage": { "chinese": "死", "name": "Death" },
        "decade": { "index": 0, "fromAge": 3, "toAge": 12 }
      }
    ]
  }
}
// 03 / Parametry

Parametry

nametypeWymagane
date string (YYYY-MM-DD) tak Birth date. It is converted to a lunar date, because Zi Wei is a lunar system.
time string (HH:MM:SS) tak Local clock time. Required: the soul palace is placed from the double-hour, so a chart without it would be twelve palaces of confident nonsense rather than a partial answer.
gender string tak male or female. It sets the direction of the twelve life stages, the scholar cycle and the decade limits, so the chart cannot be built without it.
age number nie Return the annual-limit palace for this age. Omit and the field comes back null.
yearDivide string nie lunar (default: the year opens on day one of the first lunar month) or lichun (the BaZi boundary, for reconciling against a calculator that imported it).
fixLeap boolean nie Split a leap month at day 15 (default) or count the whole of it as the month it follows.
dayDivide string nie forward (default: 23:00 belongs to the next day) or current (keep the date and mark the hour as the late Zi).
school string nie The 四化 table: zhongzhou (default), quanji, quanshu or beipai. The four disagree on three of the ten year stems.
language string nie Any of 21 codes. Palace names and life-stage names come back translated; star names stay as characters with an English gloss.
// 04 / Kiedy używać

Kiedy używać

Reach for it when you are building a Chinese-astrology product for a market that reads anything other than Chinese: an app, a reading service, a chart renderer, an agent that needs the structure before it interprets. The response is pure structure with no prose, so it drops into a twelve-palace grid, a report generator or an LLM prompt equally well. The reference endpoints in the same family are cheaper and useful for glossaries and tooltips, but they return the same table for every birth and say so in a field, so do not build a chart out of them.

// 05 / Uwagi

Uwagi

Pinned to three published charts rather than to one library, deliberately: nearly the whole open-source Zi Wei ecosystem descends from a single project, so agreeing with several of them is agreeing with one. Two full charts reproduce exactly, and a third comes from an unrelated teaching text. Four school switches live in the request body rather than in our code, because each moves the whole chart for the births it touches: the year boundary, the leap month, the 23:00 rollover and the transformation table. When another calculator disagrees, check those four before the arithmetic.

Wypróbuj API Zi Wei Dou Shu

Zdobądź klucz i wykonaj pierwsze wywołanie w niecałą minutę.

99.9% SLA · plany płatne · 30d status →