真太阳时已升级出生地经度已精确到分钟;接近时辰交界,请确认准确时刻。

FREE PUBLIC API · NO KEY

Chart API

Cast a real Zi Wei Dou Shu (紫微斗数) natal chart and BaZi (八字) Four Pillars from a birth date, time and place. True-solar-time corrected, no API key, CORS enabled, and nothing you send is stored.

Quick start

One request, no signup:

curl "https://www.14mainstars.com/api/public/chart?date=1993-11-04&hour=21&minute=15&gender=male&cityId=kl&lang=en"

Returns the main star with its rarity, all twelve palaces, the Four Pillars, the Day Master and the five-element distribution.

Endpoints

GET/POST /api/public/chart
Casts the chart. Required: date (YYYY-MM-DD), hour (0-23), gender (male|female), cityId. Optional: minute, calendar (solar|lunar), lang (zh|en), name.
GET /api/public/cities
Resolves a birthplace name to the cityId the chart endpoint expects. Birthplace is required because the chart is corrected to true solar time, which depends on longitude.
/api/public/openapi.json
OpenAPI 3.1 schema — import it directly into Postman, an OpenAPI client, or a ChatGPT Action.

Limits & honest caveats

  • · Authentication: none. Rate limit: 20 chart requests per minute per IP.
  • · Returns calculated STRUCTURE only — the same free tier the website shows. Written interpretation chapters are a paid reading and are never returned by this API.
  • · Nothing is stored: no account, no saved chart, no birth data written to our database. We keep only an anonymous count of calls.
  • · Best effort, no SLA. It powers our own site and our ChatGPT assistant, so it is kept working — but please do not build anything life-critical on it.
  • · Zi Wei Dou Shu and BaZi are traditional symbolic systems offered for reflection, not verified prediction.

Attribution

Free to use. If it is useful in something public, a link back to 14mainstars.com is appreciated but not required. Interpretations on the site are rule-based on 15 classical texts, listed at /sources.