BaZi (Four Pillars of Destiny)
/api/v1/chinese/baziCalculate the complete Four Pillars of Destiny (八字) chart based on birth date, time, and location. Includes Day Master analysis, Ten Gods, Life Stages, element balance, and optional professional features.
Full URL
https://api.freeastroapi.com/api/v1/chinese/baziAvailable Features
Year, Month, Day, Hour with Stems & Branches
Relationship of each stem to Day Master
Inner energies within each branch
12 Di Shi (growth stages) per pillar
10-year Da Yun periods from birth
Five elements point distribution
Romanization for Chinese characters
Tian Yi, Peach Blossom, etc.
Combinations, Clashes, Harms, Punishments
DM Strength, Structure, Yong Shen analysis
Time corrections and professional calculation details
Current annual-flow triggers
Time Standard Options
Uses standard clock time directly. Best for modern births.
Applies longitude and equation-of-time corrections relative to the timezone's standard meridian.
Uses local mean time plus the equation of time, independent of the civil timezone offset.
Request Parameters
favorable_elements and unfavorable_elements are mutually exclusive.Sample Code
curl -X POST "https://api.freeastroapi.com/api/v1/chinese/bazi" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"year": 1990,
"month": 5,
"day": 15,
"hour": 10,
"minute": 30,
"lat": 28.6139,
"lng": 77.2090,
"city": "New Delhi",
"sex": "M",
"time_standard": "civil",
"calendar": "gregorian",
"tz_str": "Asia/Kolkata",
"include_ten_gods": true,
"include_pinyin": true,
"include_stars": true,
"include_interactions": true,
"include_professional": true,
"include_debug": false
}'Response Data
{
"day_master": {
"stem": "庚",
"pinyin": "gēng",
"info": {
"name": "Geng",
"element": "Metal",
"polarity": "Yang"
}
},
"pillars": [
{
"label": "year",
"gan": "庚",
"zhi": "午",
"gan_pinyin": "gēng",
"zhi_pinyin": "wǔ",
"ten_gods": {
"stem": "Friend",
"hidden": [
{ "gan": "丁", "ten_god": "Direct Officer" },
{ "gan": "己", "ten_god": "Direct Resource" }
]
},
"nayin": "路旁土",
"life_stage": { "chinese": "沐浴", "name": "Bath" }
}
],
"elements": {
"points": {
"Wood": 5,
"Fire": 75,
"Earth": 40,
"Metal": 90,
"Water": 5
},
"dominant": "Metal"
},
"professional": {
"dm_strength": "Weak",
"structure": "7 Killings Structure",
"yong_shen_candidates": ["Metal (Jin)", "Earth (Tu)"],
"favorable_elements": ["Metal (Jin)", "Earth (Tu)"],
"unfavorable_elements": ["Water (Shui)", "Fire (Huo)"]
},
"metadata": {
"engine_version": "1.4.0",
"ruleset": "Standard Traditional (SwissEph)"
}
}Related Endpoints
Showcase Example
See what you can build with our BaZi API. our official open-source calculator demonstrates how to visualize the four pillars, luck cycles, and element balance using this exact endpoint.
View BaZi Calculator on GitHub