BaZi API

The Definitive BaZi API

Generate the Four Pillars of Destiny directly from a precise time and location. Get the exact Stems, Branches, and hidden elements with mathematical astronomical rigor.

Astronomical BaZi Generation

BaZi requires exact solar terms to calculate the month pillar, and true solar time to calculate the hour pillar. Open Ephemeris handles these astronomical complexities automatically.

1

Local Coordinate Correction

Your coordinates are used to align the provided standard time to true local solar time relative to the prime meridian.

2

Solar Term Tracking

The Sun's position is verified against the 24 solar terms (Jieqi) to ensure the month pillar reflects the exact seasonal transition.

3

Stem & Branch Resolution

The precise 10 Heavenly Stems and 12 Earthly Branches are computed alongside their hidden elemental interactions.

四柱命盤 · Four Pillars of Destiny
Autumn
← read right-to-lefttraditional order →
時 Hour
GuǐYin Water
Wèi🐐 Goat
藏干
日 Day
Day Master · Yin Wood
Mǎo🐇 Rabbit
藏干
月 Month
JiǎYang Wood
🐕 Dog
藏干
年 Year
JiǎYang Wood
🐕 Dog
藏干
Nov 7, 1994 · 19:59 UTC立冬 Lì Dōng · Start of WinterNov 7, 1994 · 20:01 UTC
☀ Solar longitude: 222.40°Jieqi threshold: 225.00°
GET /ephemeris/bazi → response.json
awaiting...
{
  "data": {
    "day_master": "Yi",
    "element": "Wood",
    "pillars": {
      "year":  { "stem": "Jia", "branch": "Xu" },
      "month": { "stem": "Jia", "branch": "Xu",  "hidden": ["Wu","Ding","Xin"] },
      "day":  { "stem": "Yi",  "branch": "Mao" },
      "hour": { "stem": "Gui", "branch": "Wei" }
    }
  }
}

Month pillar transitions at exact Jieqi · true solar longitude computed from NASA JPL ephemerides

The Engine for Chinese Metaphysics

Four Pillars & Beyond

Calculate the exact Heavenly Stem and Earthly Branch for the Year, Month, Day, and Hour pillars.

True Solar Time

Traditional BaZi uses true solar time. We correct for longitude and the equation of time to ensure absolute precision for the Hour pillar.

Hidden Stems

Every Earthly Branch contains hidden stems (main, sub, and residual Qi). Our API calculates and returns these automatically.

JPL Solar Longitude

Month pillars shift at the exact moment the sun crosses 15° solar longitude intervals (Jieqi). We calculate this using NASA JPL ephemerides.

Calculate Destiny with Precision

The Explorer tier is free to start. Connect your app to the most accurate BaZi generation engine online.