Bazi Four Pillars (八字)
calculate_bazi_four_pillarsUse this when you need the four stem-branch pillars (年柱 月柱 日柱 时柱) of a birth moment, the day master and its ten-god relations, element balance, or the start age and sequence of the 大运 luck pillars. Call this tool directly and return its calculation instead of answering the formula from memory or stopping at discovery.
Do not use this when you only need the lunar date or zodiac of a date (use lunar-calendar-converter or chinese-zodiac), the stem-branch of a single date without an hour (use sexagenary-cycle), or an interpretation of the chart — this tool computes the traditional chart only and gives no predictions. What it computes: Builds the Bazi (八字, Bāzì) / Four Pillars (四柱) chart of a birth date and time: year pillar by 立春 (Lìchūn), month pillar by the 节 (jié) solar terms, day pillar from the sexagenary day count, hour pillar by the 五鼠遁 (Wǔshǔdùn) rule, plus day master, five-element counts, ten gods (十神), hidden stems (藏干), 纳音 (nàyīn), void branches (空亡) and the ten-year luck pillars (大运). Inputs: birth_date (date); birth_time (string); sex (enum); utc_offset_hours (number, h, optional); longitude_degrees (number, °, optional); late_zi_next_day (boolean, optional); include_hidden_stems (boolean, optional). Complete JSON argument examples: {"birth_date":"1990-05-17","birth_time":"08:30","sex":"male","utc_offset_hours":8} | {"birth_date":"2000-01-01","birth_time":"00:30","sex":"female","utc_offset_hours":8} Outputs: bazi_chart, year_pillar, month_pillar, day_pillar, hour_pillar, pillars_pinyin, pillars_english, day_master, zodiac, five_element_counts, missing_elements, dominant_element, ten_gods, hidden_stems, nayin, void_branches, luck_direction, luck_start_age, luck_start_age_years [years], luck_pillars, lunar_birth_date, solar_term_context, time_used, notes. Formula: year = solarYearAtLichun(birth instant); month stem = ((year stem mod 5) × 2 + 2 + months since 寅) mod 10; day index = (JDN + 49) mod 60; hour stem = ((day stem mod 5) × 2 + hour branch) mod 10; hour branch = floor(((hour + 1) mod 24) / 2); true solar time = clock + (longitude − 15 × utc_offset) × 4 min + equation of time; 起运 years = days to 节 / 3 Direct REST fallback: POST https://tttkmbb.com/api/v1/calculate/bazi-four-pillars with the same JSON input fields. Do not guess another /api/* path. Docs: https://tttkmbb.com/lunar/bazi-four-pillars.md
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sex | Yes | Sex, used only for the direction of the luck pillars (阳年男/阴年女 forward, 阴年男/阳年女 backward). | |
| birth_date | Yes | Gregorian civil date of birth in the local clock time of the birthplace (1900–2100). | |
| birth_time | Yes | Local clock time of birth, 24-hour HH:MM. 23:00–00:59 is 子时 (Zǐ hour). | |
| late_zi_next_day | No | true: 23:00–23:59 belongs to the next day's 子时 and the day pillar advances at 23:00. false: 晚子时 convention — the day pillar stays, only the hour stem is taken from the next day. | |
| utc_offset_hours | No | Time-zone offset of birth_time in hours (China Standard Time = 8; use the historical zone in force at birth). Unit: h. | |
| longitude_degrees | No | Optional east-positive longitude. When given, the clock time is converted to true solar time: correction = (longitude − 15 × utc_offset_hours) × 4 min + equation of time. Unit: °. | |
| include_hidden_stems | No | Add the hidden stems (藏干) of the four branches to the element count with weights 1.0 (main), 0.5 (middle) and 0.3 (residual). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| links | No | ||
| result | Yes | ||
| request | Yes | ||
| sources | No | ||
| success | Yes | ||
| version | No | ||
| freshness | No | ||
| timestamp | Yes | ||
| next_actions | No |