Back to Docs

Neijing Life Curve

POST/api/v1/chinese/bazi/lifespan

Generates a personalized energy trajectory (Jing, Qi, Shen) across a full lifespan (0-120 years). Based on the Yellow Emperor's Classic of Internal Medicine (Neijing Suwen) cycles and BaZi luck pillar modifiers.

Full URL

https://astro-api-1qnc.onrender.com/api/v1/chinese/bazi/lifespan

Endpoint Capabilities

Dual Jing Pools

Differentiates between inherited Prenatal Integrity and acquired Postnatal buffer

Qi Duality

Tracks Pre-Heaven Yuan Qi (innate flow) vs Post-Heaven metabolic energy

Prenatal Leakage

Simulates how poor lifestyle choices and bad luck drain your original life reservoir

Neigong Modulation

Use the cultivation_factor to simulate how practice and attention preserve structural integrity

Shen Coherence

Mental clarity derived from the stability of the Pre/Post-Heaven energy field

Request Parameters

ParameterTypeRequiredDescription
yearintegerYesYear of birth
monthintegerYesMonth of birth (1-12)
dayintegerYesDay of birth (1-31)
hourintegerYesHour of birth (0-23)
minuteintegerYesMinute of birth (0-59)
citystringYesCity name (used for coordinate lookup via /geo/search)
latfloatNoLatitude (-90 to 90). Optional: auto-resolved from city
lngfloatNoLongitude (-180 to 180). Optional: auto-resolved from city
sexstringYes'M' (male) or 'F' (female)
max_ageintegerNoSimulation duration in years. Default: 120
cultivation_factorfloatNoLevel of Neigong/Practice (0.0 to 1.0). Modulates energetic depletion and stability. Default: 0.5

Sample Code

import requests
import json

url = "https://astro-api-1qnc.onrender.com/api/v1/chinese/bazi/lifespan"

payload = {
    "year": 1990,
    "month": 5,
    "day": 15,
    "hour": 10,
    "minute": 30,
    "lat": 34.05,
    "lng": -118.24,
    "sex": "M",
    "max_age": 100,
    "cultivation_factor": 0.8  # 0.0 to 1.0 (Neigong/Attention level)
}

headers = {
    "Content-Type": "application/json",
    "x-api-key": "YOUR_API_KEY"
}

response = requests.post(url, headers=headers, json=payload)
print(response.json())

Response Data Structure

Each object in the curve array represents one year of the simulated lifespan.

{
  "metadata": {
    "max_age": 100,
    "sex": "Male",
    "cultivation_level": 0.8,
    "algorithm": "Neijing-Bazi-Hybrid v1.1 (Neigong-Modulated)"
  },
  "curve": [
    {
      "age": 0,
      "year": 1990,
      "j0": 58.0,
      "j_final": 58.0,
      "jing_prenatal": 58.0,
      "jing_postnatal": 0.0,
      "qi": 10.7,
      "qi_pre_heaven": 11.2,
      "qi_post_heaven": -0.5,
      "prenatal_integrity": 1.0,
      "shen": 22.1,
      "S": 0.45,
      "D": 0.32,
      "V": 0.05,
      "H": 0.75,
      "explain": "Annual Combinations"
    },
    // ... data per year
    {
      "age": 45,
      "year": 2035,
      "j0": 89.0,
      "j_final": 82.4,
      "jing_prenatal": 78.5,
      "jing_postnatal": 3.9,
      "qi": 65.2,
      "qi_pre_heaven": 58.2,
      "qi_post_heaven": 7.0,
      "prenatal_integrity": 0.882,
      "shen": 78.5,
      "S": -0.2,
      "D": 0.45,
      "V": 0.35,
      "H": 0.5,
      "explain": "Luck Clash with Zi"
    }
  ]
}