Chinese astrology API: Bazi

The four pillars of Bazi, luck pillars, a year against a chart, relations between two charts, the birth animal by both conventions, the Chinese calendar date and the 24 solar terms.

OperationCreditsKey
POST /v1/chinese/bazi
The four pillars with hidden stems, ten gods, nayin and element counts
2secret
POST /v1/chinese/luck-pillars
The ten-year luck pillars, their direction and the age they start
1secret
POST /v1/chinese/annual
A solar year's pillar against a chart: Tai Sui, relations and the twelve month pillars
1secret
POST /v1/chinese/compatibility
Harmonies and conflicts between two charts' year and day pillars
1secret
POST /v1/chinese/zodiac
The birth year animal by Li Chun and by Lunar New Year, and whether they agree
1secret
POST /v1/chinese/date
A Gregorian date in the Chinese calendar: lunar month and day, leap month, day pillar and solar term
1secret
POST /v1/chinese/solar-terms
The 24 solar terms of a year, to the minute
1secret

Example: The four pillars with hidden stems, ten gods, nayin and element counts

POST /v1/chinese/bazi · 200 OK
{
  "data": {
    "moment": "1990-08-13T01:00:00.000Z",
    "time_known": true,
    "time_basis": "clock",
    "zi_convention": "day_changes_at_23",
    "zi_hour": null,
    "solar_year": 1990,
    "pillars": {
      "year": {
        "name": "Geng Wu",
        "chinese": "庚午",
        "cycle_number": 7,
        "stem": {
          "id": "geng",
          "chinese": "庚",
          "element": "metal",
          "element_name": "Metal",
          "polarity": "yang",
          "ten_god": {
            "id": "bi_jian",
            "name": "Friend"
          }
        },
        "branch": {
          "id": "wu",
          "chinese": "午",
          "animal": "horse",
          "animal_name": "Horse",
          "element": "fire",
          "element_name": "Fire",
          "polarity": "yang",
          "hidden_stems": [
            {
              "id": "ding",
              "chinese": "丁",
              "element": "fire",
              "element_name": "Fire",
              "polarity": "yin",
              "ten_god": {
                "id": "zheng_guan",
                "name": "Direct Officer"
              }
            },
            {
              "id": "ji",
              "chinese": "己",
              "element": "earth",
              "element_name": "Earth",
              "polarity": "yin",
              "ten_god": {
                "id": "zheng_yin",
                "name": "Direct Resource"
              }
            }
          ]
        },
        "nayin": {
          "chinese": "路旁土",
          "name": "Earth by the Roadside"
        }
      },
      "month": {
        "name": "Jia Shen",
        "chinese": "甲申",
        "cycle_number": 21,
        "stem": {
          "id": "jia",
          "chinese": "甲",
          "element": "wood",
          "element_name": "Wood",
          "polarity": "yang",
          "ten_god": {
            "id": "pian_cai",
            "name": "Indirect Wealth"
          }
        },
        "branch": {
          "id": "shen",
          "chinese": "申",
          "animal": "monkey",
          "animal_name": "Monkey",
          "element": "metal",
          "element_name": "Metal",
          "polarity": "yang",
          "hidden_stems": [
            {
              "id": "geng",
              "chinese": "庚",
              "element": "metal",
              "element_name": "Metal",
              "polarity": "yang",
              "ten_god": {
                "id": "bi_jian",
                "name": "Friend"
              }
            },
            {
              "id": "ren",
              "chinese": "壬",
              "element": "water",
              "element_name": "Water",
              "polarity": "yang",
              "ten_god": {
                "id": "shi_shen",
                "name": "Eating God"
              }
            },
            {
              "id": "wu",
              "chinese": "戊",
              "element": "earth",
              "element_name": "Earth",
              "polarity": "yang",
              "ten_god": {
                "id": "pian_yin",
                "name": "Indirect Resource"
              }
            }
          ]
        },
        "nayin": {
          "chinese": "泉中水",
          "name": "Spring Water"
        }
      },
      "day": {
        "name": "Geng Xu",
        "chinese": "庚戌",
        "cycle_number": 47,
        "stem": {
          "id": "geng",
          "chinese": "庚",
          "element": "metal",
          "element_name": "Metal",
          "polarity": "yang"
        },
        "branch": {
          "id": "xu",
          "chinese": "戌",
          "animal": "dog",
          "animal_name": "Dog",
          "element": "earth",
          "element_name": "Earth",
          "polarity": "yang",
          "hidden_stems": [
            {
              "id": "wu",
              "chinese": "戊",
              "element": "earth",
              "element_name": "Earth",
              "polarity": "yang"
            },
            {
              "id": "xin",
              "chinese": "辛",
              "element": "metal",
              "element_name": "Metal",
              "polarity": "yin"
            },
            {
              "id": "ding",
              "chinese": "丁",
              "element": "fire",
              "element_name": "Fire",
              "polarity": "yin"
            }
          ]
        },
        "nayin": {
          "chinese": "钗钏金",
          "name": "Hairpin Metal"
        }
      },
      "hour": {
        "name": "Ji Mao",
        "chinese": "己卯",
        "cycle_number": 16,
        "stem": {
          "id": "ji",
          "chinese": "己",
          "element": "earth",
          "element_name": "Earth",
          "polarity": "yin",
          "ten_god": {
            "id": "zheng_yin",
            "name": "Direct Resource"
          }
        },
        "branch": {
          "id": "mao",
          "chinese": "卯",
          "animal": "rabbit",
          "animal_name": "Rabbit",
          "element": "wood",
          "element_name": "Wood",
          "polarity": "yin",
          "hidden_stems": [
            {
              "id": "yi",
              "chinese": "乙",
              "element": "wood",
              "element_name": "Wood",
              "polarity": "yin",
              "ten_god": {
                "id": "zheng_cai",
                "name": "Direct Wealth"
              }
            }
          ]
        },
        "nayin": {
          "chinese": "城头土",
          "name": "Earth on the City Wall"
        }
      }
    },
    "day_master": {
      "id": "geng",
      "chinese": "庚",
      "element": "metal",
      "element_name": "Metal",
      "polarity": "yang"
    },
    "elements": {
      "visible": {
        "wood": 2,
        "fire": 1,
        "earth": 2,
        "metal": 3,
        "water": 0
      },
      "hidden": {
        "wood": 1,
        "fire": 2,
        "earth": 3,
        "metal": 2,
        "water": 1
      }
    }
  },
  "meta": {
    "request_id": "req_example",
    "api_version": "v1",
    "engine_version": "2026.10.10",
    "mode": "live",
    "credits_charged": 2
  },
  "warnings": []
}

Try it in the playground Full reference