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

Chinese metaphysics API

53 endpoints across four families: BaZi (18), the Chinese calendar and zodiac (15), Zi Wei Dou Shu (14) and I Ching (6). The calendar is derived from the ephemeris rather than from date tables, so it works for years 2 through 2899 and does not depend on whether somebody refreshed a reference.

FamilyEndpointsState
BaZi: pillars and analysis18The full classical apparatus
Calendar, zodiac, feng shui, Tong Shu15Derived from the ephemeris
Zi Wei Dou Shu14Star placement computed, eleven glossaries stay glossaries
I Ching6Hexagrams, coin toss, changing lines

The honest answer: if all you need is the four pillars, take lunar-typescript. It is MIT, it runs in your own process, offline, with no rate limit, and you should not pay for that.

The difference starts where the library stops.

FeatureMIT librariesAstroWay API
Four pillars, 藏干, na yin, 十神yesyes
神煞 with both readings where the schools partnoyes
Branch interactions 刑冲合害noyes
Day-master strength in the 扶抑 framenoyes
True solar time as a first-class computationnoyes
Flying stars by sitting and facing, the Kua numbernoyes
Tong Shu date selection filtered by activitynoyes
Twenty-one languagesnoyes
One convention across PHP, JavaScript and Python at oncenoyes

That last row is what people actually pay for. A team whose site is PHP, whose app is JavaScript and whose crons are Python otherwise keeps three implementations of the year boundary, and sooner or later gets three different answers for one birth date.

Four axes where calculators part company, and none of them is a bug. Most implementations choose silently; we write the choice into the response and keep a conventions page with a run against an external CC0 dataset.

AxisOur answer
Year boundary立春 Lichun, the exact instant from the ephemeris
Day rollover23:00, so the early 子時 belongs to the next day
True solar timeoff by default, switched on by a flag
Daylight savingsettled by the timezoneOffset the client sends
Terminal window
curl -X POST https://api.astroway.info/v1/bazi/chart \
-H "X-Api-Key: $ASTROWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"date":"1990-05-15","time":"14:30:00","timezoneOffset":3}'

Animals, elements, yin and yang, the palaces and the twelve stages are translated into 21 languages. Add ?lang=es and a *Name field appears next to the English token. The English fields never change: localisation adds, it does not replace.

Stems, branches, star names and na yin are deliberately not translated: their international form is pinyin next to the character.

Was this helpful?
Suggest an edit

Last updated: