The best BaZi API for most developers in 2026 is FreeAstroAPI. It combines a complete Four Pillars chart, Ten Gods, Hidden Stems, 12 Life Stages, luck cycles, Shen Sha, interactions, Day Master strength, structure, Yong Shen, and three time-standard modes under one API. Its permanent free plan allows 80 requests per day, while the first production plan costs $8 per month for 50,000 requests.
It is not the best at every detail. RoxyAPI is the strongest choice when your product must expose selectable BaZi school conventions. Its request schema explicitly controls the year boundary, day boundary, and hour clock, then echoes the applied conventions in the response. Saju API is the best inexpensive option for a product serving both Korean Saju and Chinese BaZi users.
This guide compares 15 hosted BaZi and Four Pillars APIs by calculation depth, boundary controls, time correction, output structure, free access, pricing, and production risk. The search covered English, Simplified Chinese, Traditional Chinese, Korean, and Japanese provider documentation.
Disclosure: This comparison is published by FreeAstroAPI. Provider capabilities and prices link to their official pages. We rank FreeAstroAPI first, but identify where competing products have a clearer or more specialized implementation. Provider claims are treated as claims unless a reproducible independent test is linked.
Last verified: August 31, 2026. Pricing, limits, and calculation behavior can change, so verify the linked documentation before committing a production architecture.
Quick answer
| Use case | Best pick | Why |
|---|---|---|
| Best BaZi API overall | FreeAstroAPI | Deep BaZi output, true solar time options, related BaZi endpoints, a permanent free tier, and a $8 production plan. |
| Best for explicit BaZi school conventions | RoxyAPI | Typed controls for Li Chun or Lunar New Year, Zi-hour day boundaries, and civil or solar-time clocks. |
| Best published BaZi validation evidence | OpenEphemeris | A 56-case canonical test suite, exact solar terms, explicit Zi-hour handling, visual charts, and structured analysis endpoints. |
| Best Chinese-first BaZi infrastructure | FateAPI | Auditable true solar time, historical DST, unknown-hour handling, five-language terminology maps, and low RMB pricing. |
| Best full-depth Korean Saju API | SAZU | 17 analysis modules, true solar time, TypeScript SDK, MCP, and Korean-first daily, monthly, yearly, and decade flows. |
| Best established Chinese metaphysics catalog | Yuanfenju | Eight BaZi services, selectable Zi-hour rules, global true solar time, and a large Chinese metaphysics API catalog. |
| Best multilingual BaZi sandbox | Vedika | Free no-key sandbox, 30 production languages, and BaZi, Feng Shui, Zi Wei Dou Shu, and Chinese calendar endpoints. |
| Best free Korean Saju and Chinese BaZi API | Saju API | 3,000 calls per month, 10 languages, separate Saju and BaZi labels, and all endpoints on the free tier. |
| Best free no-signup BaZi endpoint | 14 Main Stars | No key, 20 requests per minute, OpenAPI 3.1, true solar time, and combined BaZi plus Zi Wei output. |
| Best Korean production Saju platform | Ablecity | Local mean time, explicit midnight handling, Saju flows, callbacks, compatibility, and contract-based onboarding. |
| Best Japanese Four Pillars API | Neo Bazi Solutions | Japanese Ten Gods and 12 Life Stages, longitude correction, and official Japanese solar-term data. |
| Widest astrology catalog with BaZi included | AstroWay | 12 BaZi endpoints inside a 748-endpoint platform, plus OpenAPI, SDKs, and MCP. |
| Best tiny free BaZi sampler | Astrology-API.io | 50 free calls per month and a simple path into a broader astrology catalog. |
| Best BaZi API with a built-in LLM reading | askTIAN | A complete chart and eight Da Yun cycles with generated English or Traditional Chinese interpretation. |
| Best pay-per-chart automation option | Apify BaZi Chart API | A community Actor with per-chart billing and structured results based on lunar-typescript. |
BaZi API comparison table
| Rank | API | Free access | Starting production price | BaZi depth | Main tradeoff |
|---|---|---|---|---|---|
| 1 | FreeAstroAPI | 80 requests/day; 1 request/sec | $8/month for 50,000 requests | Four Pillars, Ten Gods, Hidden Stems, Life Stages, Da Yun, Shen Sha, interactions, strength, structure, Yong Shen, flow | Does not expose school conventions as explicitly as RoxyAPI, and the free allowance resets daily. |
| 2 | RoxyAPI | Live playground; no free production tier | $39/month for 50,000 requests | BaZi, strength, Luck Pillars, annual forecast, solar terms, Chinese calendar, Tong Shu | Higher entry price, and its published BaZi feature page does not list a Shen Sha layer. |
| 3 | OpenEphemeris | 150 one-time credits | $22/month billed annually for 75,000 credits | BaZi, Ten Gods, Luck Pillars, annual pillar, compatibility, element balance, Yong Shen, solar terms, SVG/PNG charts | Advanced BaZi calls cost three credits and require Pro; free credits are a one-time grant. |
| 4 | FateAPI | 5,000 starting workspace calls | ¥49/month for 20,000 calls | Pillars, strength, Ten Gods, Na Yin, structure, relations, Da Yun, annual flow, true-solar audit | Newer provider with Chinese-only commercial documentation and no public SLA or status page found. |
| 5 | SAZU | 500 fixed-sample sandbox calls/month | ₩29,900/month for 10,000 real calculations | 17 Saju modules, structure, Yongshin, Sinsal, interactions, luck cycles, true solar time | Free keys return fixed sample profiles, not calculations for arbitrary birth data. |
| 6 | Yuanfenju | 150 one-time trial calls | ¥499 for 2,500 calls, or ¥1,000/year for 500 calls per 24 hours | Pillars, Ten Gods, Hidden Stems, Life Stages, Na Yin, Shen Sha, Da Yun, true solar time, deep readings | Chinese-first form-encoded API, no public SLA on standard plans, and lunar leap months require a separate conversion call. |
| 7 | Vedika | Free sandbox without a key | $12/month wallet; BaZi calls listed at $0.016 | Chart, analysis, Day Master strength, favorable elements, Luck Pillars, annual interactions | The sandbox is for testing, not a recurring free production allowance; pricing uses wallet credits. |
| 8 | Saju API | 3,000/month, capped at 100/day and 1 request/sec | $9/month for 30,000 requests | BaZi and Saju labels, Ten Gods, Life Stages, Hidden Stems, Yongshin, Daeun, compatibility | Small specialist provider; paid upgrades are manually provisioned rather than instant self-service. |
| 9 | 14 Main Stars | No key; 20 requests/minute per IP | Free chart structure | Four Pillars, Day Master, Five Elements, lunar date, true solar time, Zi Wei chart | Basic BaZi output only, no Ten Gods or Luck Pillars, and explicitly no SLA. |
| 10 | Ablecity | First 100 test calls | From $75/month | Saju chart, Five Elements, Ten Gods, Daeun, Gongmang, Sinsal, luck flow, compatibility | Onboarding and final pricing are contract-based; overseas city normalization is handled during onboarding. |
| 11 | Neo Bazi Solutions | 100 credits/month, equal to 10 calls | ¥980/month for 1,000 credits, equal to 100 calls | Four Pillars, true solar time, Ten Gods, Hidden Stems, 12 Life Stages, Five Elements | Low effective quotas; Luck Cycles, detailed Shen Sha, compatibility, and annual flows remain roadmap items. |
| 12 | AstroWay | 10,000 credits/month; BaZi endpoints cost 10 credits | $5/month for 50,000 credits | 12 BaZi endpoints for pillars, elements, Day Master, Ten Gods, Luck Pillars, yearly and monthly flows | Effective free allowance is about 1,000 BaZi calls, and recent correctness fixes require careful regression testing. |
| 13 | Astrology-API.io | 50 calls/month | $11/month for 1,000 requests | Four Pillars, Five Elements, Ten Gods, Luck Pillars, Day Master strength, local solar time | Very small free quota; several accuracy and performance claims lack a public reproducible methodology. |
| 14 | askTIAN | No recurring free tier found | 15 TIAN points per chart, about $1.50 at the listed point price | Complete chart, Na Yin, Hidden Stems, Ten Gods, Life Stages, element balance, eight Da Yun cycles, LLM reading | Expensive per chart and dependent on a proprietary point wallet. |
| 15 | Apify BaZi Chart API | Depends on Apify platform credits | $10 per 1,000 charts, plus platform compute | Pillars, Hidden Stems, Na Yin, Ten Gods, element distribution, Day Master strength, Luck Cycles | Community Actor rather than a specialist vendor; platform and compute costs are separate. |
How we evaluated the APIs
BaZi APIs can return different charts for the same birth data without either server failing. The disagreement often comes from an unstated convention, not a JSON bug. We therefore weighted calculation transparency more heavily than the number of endpoints on a marketing page.
The ranking uses these criteria:
- Solar-term boundaries: The month pillar should follow solar terms, and the year boundary must be documented as Li Chun, Lunar New Year, or another convention.
- Day and Zi-hour boundaries: A birth around 23:00 can change the day pillar under different schools. The API should expose or document its rule.
- Timezone and historical DST: An IANA timezone is safer than a fixed UTC offset for historical birth data.
- Time correction: Civil time, local mean time, and apparent true solar time are different inputs. A production API should say which it applies.
- Chart depth: We checked Four Pillars, Heavenly Stems, Earthly Branches, Hidden Stems, Na Yin, Ten Gods, Five Elements, 12 Life Stages, Day Master analysis, and interactions.
- Timing techniques: Luck-cycle direction, Da Yun start age, annual pillars, monthly flow, and current-flow data matter for forecasting products.
- Developer experience: Stable JSON, documented null behavior, OpenAPI, SDKs, examples, rate limits, and error responses reduce integration risk.
- Localization: Hanzi, Pinyin, Korean labels, Traditional Chinese, Simplified Chinese, and translated interpretation text serve different products.
- Commercial path: We distinguished a mock sandbox, a test key, a recurring free production tier, and a contracted paid service.
We did not run a cross-provider numerical benchmark because most production endpoints require separate account creation or payment, and the providers do not all expose the same convention settings. Calling each with its defaults would produce a misleading league table. The boundary-case test suite later in this guide is the right way to evaluate shortlisted providers against the conventions your product intends to use.
Provider discovery used English, Simplified Chinese, Traditional Chinese, Korean, and Japanese searches, followed by checks of official documentation, pricing, changelogs, OpenAPI files, SDK repositories, and public API surfaces. We excluded providers when we could not verify a usable BaZi endpoint or current commercial terms from a primary source.
On August 31, 2026, we also sent one synthetic chart request from Paris to the anonymous public surfaces of FateAPI and 14 Main Stars. Both returned HTTP 200. FateAPI responded in about 432 ms and 14 Main Stars in about 656 ms. These were single-request response-shape checks, not speed benchmarks: the sample size was one, the services used different payloads, and we did not record the negotiated HTTP version or a latency distribution. No personal birth data or secret key was used. The input characteristics and returned fields are documented in the relevant sections below.
What should a good BaZi API return?
A minimal endpoint returns the Year, Month, Day, and Hour pillars. That is enough to draw eight characters, but it is not enough for a serious reading or a transparent product.
A useful response should include:
- Heavenly Stem and Earthly Branch objects for all four pillars.
- Element, polarity, Hanzi, and ideally Pinyin for each character.
- Hidden Stems and their Ten God relationships to the Day Master.
- Five-Element counts or weighted strength values, with the calculation method identified.
- Day Master strength, favorable and unfavorable elements, structure, or equivalent analysis.
- Na Yin and the 12 Life Stages if the product displays traditional supporting layers.
- Da Yun direction, calculated start age, and dated 10-year cycles.
- The time standard, timezone, location, and boundary conventions actually applied.
- Warnings when the birth hour, city, timezone, or historical offset is uncertain.
Interpretive text is optional. Deterministic chart facts are more important because an application can translate, format, or explain them without recalculating the chart.
1. FreeAstroAPI: best BaZi API overall
FreeAstroAPI's BaZi endpoint returns the Four Pillars, Ten Gods, Hidden Stems, 12 Life Stages, 10-year Luck Cycles, Five-Element balance, and optional Pinyin. Its optional layers include Shen Sha, combinations, clashes, harms, punishments, Day Master strength, chart structure, and Yong Shen analysis.
The time model is the main reason it ranks first overall. A request can use standard civil time, longitude-based local mean time, or apparent true solar time with equation-of-time correction. A separate BaZi time-correction endpoint makes that conversion visible before the chart is calculated. IANA timezone support and location coordinates make the request easier to audit than an unexplained local timestamp.
The BaZi surface extends beyond one natal chart:
- Chinese calendar conversion
- BaZi synastry
- Current and future flow
- Health and constitution analysis
- Neijing life-cycle data
- Current Four Pillars and a BaZi dictionary
Pricing is unusually simple. The permanent free tier includes 80 requests per day at one request per second and permits commercial use. Entry costs $8 per month for 50,000 requests at five requests per second. High costs $40 for 500,000 requests at ten requests per second. Hosted MCP access is included on every plan.
The tradeoff is explicit convention control. FreeAstroAPI documents its time standards, but RoxyAPI presents year-boundary, day-boundary, and hour-clock choices more clearly as one typed conventions object. Teams supporting multiple BaZi schools should compare those controls before choosing.
Choose FreeAstroAPI when you want the most complete BaZi product surface, need Shen Sha or Yong Shen fields, want true solar time to be auditable, or need a free prototype to grow into an inexpensive production plan.
2. RoxyAPI: best for explicit BaZi school conventions
RoxyAPI's Chinese Astrology API handles the hardest integration problem directly: it asks which calculation convention you want.
The BaZi request supports controls such as:
{
"conventions": {
"dayBoundary": "split-zi",
"yearBoundary": "li-chun",
"hourClock": "clock"
}
}The applied convention is returned with the chart. That is excellent API design for practitioners, auditors, and apps that let users switch schools. RoxyAPI also supports local mean and apparent solar clocks, IANA timezones and DST, Luck Pillars, annual forecasts, solar terms, a lunisolar calendar, Tong Shu date selection, and Chinese astrology UI components.
It has the strongest developer-tooling package in this comparison: TypeScript, Python, PHP, C#, and Go SDKs, OpenAPI, a remote MCP server, templates, and reusable widgets. The wider subscription bundles 14 domains, which is attractive if the same app also needs Western astrology, Vedic astrology, Tarot, numerology, Human Design, or Feng Shui.
The entry plan starts at $39 per month for 50,000 requests. There is a live playground without a card, but no recurring free production quota. The price is reasonable for a multi-domain product and relatively high for an app that only needs occasional BaZi charts. Its published BaZi page does not list Shen Sha, so confirm that layer if it is required.
Choose RoxyAPI when school transparency is the first requirement, or when typed SDKs and a broad commercial API suite matter more than the lowest entry price.
3. OpenEphemeris: best published BaZi validation evidence
OpenEphemeris separates the natal chart from advanced BaZi analysis. Its basic /chinese/bazi endpoint costs one credit and can be used on the Explorer tier. The endpoint rolls the year and month at solar terms, offers an explicit zi_hour day boundary, and returns metadata about the exact term and boundary decisions used in the calculation.
Pro access adds structured endpoints for Ten Gods, Luck Pillars, annual pillars, compatibility, element balance and Yong Shen, and exact solar-term instants. Those calls cost three credits each. The same platform can render BaZi charts as SVG or PNG, which is useful for report generation and embeds.
The strongest differentiator is evidence. OpenEphemeris publishes a 56-case BaZi validation suite covering year pillars from 1900 through 2024, Jia and Yi Ten God matrices, Hidden Stems, Na Yin, and other canonical checks. This is provider-published validation rather than an independent audit, but it is more inspectable than an unexplained accuracy percentage.
Pricing starts with 150 one-time Explorer credits without a card. Top-ups begin at $5 for 150 credits. Pro costs $22 per month when billed annually and includes 75,000 credits. The account currently stops when credits run out because automatic overage billing is not live.
Choose OpenEphemeris when published test evidence, exact solar terms, structured analysis endpoints, or chart rendering matter most. Confirm whether you need Shen Sha or another interpretation layer not listed in its public BaZi catalog.
4. FateAPI: best Chinese-first BaZi infrastructure
FateAPI is a Chinese-first metaphysics backend with a versioned /v2/calculations/bazi endpoint. A response can include the Four Pillars, Five-Element strength, Ten Gods, Na Yin, chart structure, stem and branch relations, Da Yun, and annual flow.
Its time audit is unusually useful. Requests accept an IANA timezone, historical daylight-saving rules, latitude, longitude, and a true_solar choice. Longitude correction is enabled by default when coordinates are supplied, and the response records the time decisions it applied. If time_known is false, the service does not fabricate an Hour Pillar.
Localization is designed for data products rather than translated prose alone. FateAPI supports Simplified Chinese, Traditional Chinese, English, Japanese, and Korean terminology maps while preserving canonical Chinese identifiers. Responses include both a calculation version and a dictionary version, which helps prevent silent data drift.
Each workspace starts with 5,000 calls. The wording describes this as a starting balance, not a recurring monthly free tier. Paid plans begin at ¥49 per month for 20,000 calls, followed by ¥99 for 100,000 and higher-volume tiers. The documented default limit is 600 requests per IP per minute.
For our smoke test, a synthetic request using Paris coordinates, an IANA timezone, gender, and a target year returned HTTP 200 in about 432 ms. The response identified calculation version bazi-v3-extended-relations and contained the four pillars, Day Master profile, Five Elements, Ten Gods, natal relations, structure, Da Yun, and a time audit. The sample size was one, so this confirms reachability and response shape only.
Choose FateAPI for a Chinese-first product that needs auditable time handling, versioned terminology, or honest unknown-hour behavior. Its main commercial risk is maturity: we did not find a public SLA, status page, or English commercial documentation linked from the official site.
5. SAZU: best full-depth Korean Saju API
SAZU is a Korean-first Saju platform with 17 documented analysis modules. The core response covers the Four Pillars, Five Elements, Ten Gods, structure, Yongshin, Sinsal, interactions, Daeun, Seun, monthly flows, and evaluation. Separate v2 endpoints provide daily, monthly, yearly, decade, and life-period analysis.
The time model includes longitude and equation-of-time correction, historical daylight-saving handling, and a published set of 71 supported cities. An official TypeScript client is available as @sazuapp/client, and the Pro tier includes MCP access.
Its free allowance needs careful wording. Free keys receive 500 calls per month at ten requests per minute, but they can calculate only five fixed sample profiles. They are useful for integration testing, not arbitrary customer birth data. Pro costs ₩29,900 per month for 10,000 real calculations at 30 requests per minute, with listed overage billing of ₩10 per call.
Choose SAZU when Korean terminology and deep Saju flow modules are central to the product. Do not model its free sandbox as a production free tier.
6. Yuanfenju: best established Chinese metaphysics catalog
Yuanfenju has operated since 2020 and documents a broad Chinese metaphysics catalog. Its BaZi group includes basic charting, detailed charts, compatibility, combined charts, future fortunes, daily fortunes, and annual wealth analysis.
The basic BaZi chart endpoint is deeper than its name suggests. It returns the Four Pillars, Ten Gods, Hidden Stems, 12 Life Stages, Na Yin, Shen Sha, Kong Wang, chart structure, Da Yun start data, and dated annual pillars. The request can choose between two late-Zi-hour day rules. It can also use no correction, a China city correction, or global true-solar correction with coordinates and an IANA timezone for daylight-saving handling.
New accounts receive 150 one-time trial calls. Production pricing starts at ¥499 for 2,500 calls that do not expire. Annual plans begin at ¥1,000 for 500 calls per rolling 24-hour period. Every request uses one shared call from the allowance, regardless of endpoint.
The tradeoffs are integration style and internationalization. The API uses form-encoded requests, its core documentation and most base fields are Chinese-first, and lunar leap months must be converted to a Gregorian date with a separate endpoint. The standard plan page does not promise an SLA; an enterprise unlimited plan lists 5 to 15 QPS and negotiated service capacity.
Choose Yuanfenju for a Chinese-language product that needs a mature, wide traditional-metaphysics catalog and detailed BaZi data. It is less convenient than a typed JSON and OpenAPI product for a globally distributed engineering team.
7. Vedika: best multilingual BaZi sandbox
Vedika's Chinese Astrology API offers 15 endpoints covering BaZi charts and analysis, Luck Pillars, Chinese calendar conversion, zodiac compatibility, Feng Shui directions, Flying Stars, and Zi Wei Dou Shu.
The free sandbox does not require an API key. It is useful for inspecting payloads and testing a UI, but it is not a recurring production allowance. Production uses a wallet model starting at $12 per month. The site lists both the BaZi chart and BaZi analysis endpoints at $0.016 per call.
Localization is Vedika's clearest advantage. Its production plans advertise 30 response languages, including 14 Indic languages. This makes it a serious option for an app serving South Asian markets alongside Chinese astrology features.
The calculation pages say solar-term boundaries are produced by Vedika's XALEN ephemeris and claim validation against JPL DE440. That is a provider-published claim, not an independent benchmark in this guide. The public BaZi pages are also less explicit than RoxyAPI about selectable day and year conventions.
Choose Vedika when you need a no-key sandbox, many response languages, and Chinese, Vedic, Western, and KP calculations under a shared wallet.
8. Saju API: best free API for Korean Saju and Chinese BaZi
Saju API exposes one deterministic calculation engine through Korean /calculate and Chinese /bazi endpoints. The BaZi form adds Pinyin and English labels, while the interpretation endpoint returns Ten Gods, 12 Life Stages, Hidden Stems, Yongshin, and Daeun. Compatibility and daily endpoints support consumer product features.
The free plan is practical: 3,000 calls per month, capped at 100 per day and one request per second. Developer costs $9 per month for 30,000 calls, and Pro is listed at $49 with unmetered usage at ten requests per second. Every tier exposes the same endpoints.
The API documents useful edge behavior. An unknown birth time returns a null hour pillar instead of inventing one. It supports ten output languages and publishes OpenAPI 3.1 and a Postman collection.
Its main risk is provider maturity. The service is smaller than the multi-domain platforms, its public accuracy benchmark contains eight cases, and paid tiers are provisioned manually with a checkout link normally sent within one business day. That is workable for an indie app, but procurement-heavy teams may want a longer operating history or a formal contract.
Choose Saju API for K-content, dating, wellness, or AI products that need both Korean Saju terminology and Chinese BaZi output at a low price.
9. 14 Main Stars: best free no-signup BaZi endpoint
14 Main Stars exposes a public BaZi and Zi Wei chart API without an account or API key. The service publishes an OpenAPI 3.1 document, accepts GET or POST requests, permits browser calls with CORS, and limits each IP to 20 chart requests per minute.
A city ID is required so the engine can apply true solar-time correction. The BaZi object contains the Four Pillars, Day Master, Day Master element, Five-Element counts, and lunar date. This is enough for a basic chart display, but it does not expose Ten Gods, Luck Pillars, strength methodology, or a full interpretation layer.
For our smoke test, a synthetic chart request using a resolved city ID returned HTTP 200 in about 656 ms. The BaZi response keys were fourPillars, dayMaster, dayMasterElement, elementCount, and lunarDate. The sample size was one, so this was not a latency benchmark.
The service says it does not store birth data and records only anonymous call counts. It also describes availability as best effort and provides no SLA, so it should not be the only calculation dependency for a critical production feature.
Choose 14 Main Stars for a classroom project, prototype, or public demo that needs a real arbitrary-input chart without signup. Choose a deeper service for readings, forecasting, or contracted uptime.
10. Ablecity: best Korean production Saju platform
Ablecity's v2 Saju API is built around Korean Manse-force and production service workflows. Its base response includes the Four Pillars, Five Elements, Ten Gods, Daeun, Gongmang, zodiac compatibility, and approved Sinsal fields. Additional endpoints cover daily luck, yearly and monthly flow, matching, naming, love, wealth, and longer readings.
It exposes two details that matter near chart boundaries: a birth city for local mean time correction and a midnightType parameter for handling births around 23:00 and midnight. The documented limit is 60 requests per minute and 50,000 per day.
The first 100 calls are free for testing. Published pricing starts at $75 per month for the core Saju API, with final pricing based on plan, volume, and scope. Keys are requested through an onboarding form rather than created instantly. Several analysis endpoints are asynchronous and deliver results to an X-Callback-URL.
Ablecity is strongest for a Korean-facing service that values Saju terminology, add-on analyses, and contract-defined support. It is less convenient for a global developer who wants instant signup, public flat pricing, and standardized overseas location handling.
11. Neo Bazi Solutions: best Japanese Four Pillars API
Neo Bazi Solutions provides a Japanese Four Pillars endpoint with Heavenly Stems, Earthly Branches, Ten Gods, Hidden Stems, hidden-stem Ten Gods, 12 Life Stages, Five-Element balance, and a basic summary. It applies longitude correction relative to Japan Standard Time at 135 degrees east.
The provider says its 24 solar-term data comes from the National Astronomical Observatory of Japan and covers 1900 through 2100. That makes it a useful Japanese-specific candidate, particularly when local terminology matters.
Every request costs ten credits. The free tier includes 100 credits per month, equal to ten calls. Plus costs ¥980 per month for 1,000 credits, equal to 100 calls. Advanced is ¥6,980 for 10,000 credits, and Pro is ¥19,800 for 100,000 credits.
Several important features are not complete. The response currently leaves Na Yin empty, while detailed Shen Sha, annual and monthly luck, compatibility, and comprehensive analysis appear on the roadmap. The authentication documentation also shows query-string and request-body keys for browser use. Prefer the documented header option from a server because keys in URLs can leak into browser history, analytics, and proxy logs.
Choose Neo Bazi Solutions for a low-volume Japanese Four Pillars integration that needs native labels and Japan-specific solar-term sourcing. Its quotas and current feature depth are weak for a high-volume or forecasting product.
12. AstroWay: broad catalog, but verify corrected BaZi behavior
AstroWay includes 12 BaZi endpoints inside a catalog of 748 operations. The BaZi group covers the four pillars, Day Master, element balance, Ten Gods, Luck Pillars, decade cycles, hourly data, and yearly and monthly flows. The platform also publishes OpenAPI, TypeScript, Python, and PHP SDKs, plus hosted MCP.
Its free plan includes 10,000 credits per month at ten requests per minute. The endpoint cost table lists BaZi calls at 10 credits, so the effective allowance is about 1,000 BaZi calls, not 10,000 charts. The Indie plan starts at $5 per month for 50,000 credits.
AstroWay deserves credit for a detailed public changelog, but that same record requires caution. In July 2026, the provider corrected its Chinese calendar and BaZi logic to use exact solar terms and local time. The changelog says the earlier day anchor made every day pillar wrong, hour handling failed outside UTC+8, and Luck Pillar start age had been fixed at ten years. It advised users to recompute cached BaZi results.
Transparent correction is better than a silent defect. Still, these are recent changes to foundational calculations. Before production use, build regression fixtures for the corrected day pillar, Li Chun boundary, non-UTC+8 hour pillar, and Da Yun start age.
Choose AstroWay when its broad catalog is valuable and you are prepared to pin expectations to the current version and run your own boundary tests.
13. Astrology-API.io: best tiny free BaZi sampler
Astrology-API.io's BaZi product lists the Four Pillars, Five Elements, Ten Gods, Luck Pillars, Day Master strength, and local solar time. Its date range is 1900 to 2100. The permanent free plan contains 50 calls per month, and Pro starts at $11 per month for 1,000 requests.
It is easy to add to a shortlist for a personal tool or a low-volume prototype. The concern is evidence quality. The page publishes figures such as an 85 percent accuracy score and a sub-250 ms response time, but we could not find a public test corpus, sample size, region, or latency distribution supporting those numbers. The pricing grid also describes Western house-system counts on the BaZi page, which makes the product-specific entitlement less clear.
Choose it when 50 monthly calls are enough and you can validate the chart output independently. Do not select it from the marketing accuracy percentage alone.
14. askTIAN: best built-in LLM interpretation
askTIAN's BaZi API returns stems, branches, Na Yin, Hidden Stems, Ten Gods, 12 Life Stages, element balance, eight Da Yun cycles, and an LLM-generated interpretation in English or Traditional Chinese. The supported birth range is 1900 to 2100.
The endpoint costs 15 TIAN points. The platform's point pricing lists points at $0.10 each, making one BaZi response about $1.50 before any volume arrangement. That is far more expensive than a deterministic chart call from the other providers.
The value proposition is therefore not raw calculation. It is a combined chart and generated reading in one response. This can fit a concierge product or a low-volume premium report, but it is difficult to justify for a high-volume chart calculator.
Choose askTIAN when built-in narrative output is worth more than low per-chart cost. For an AI product, also consider separating deterministic BaZi facts from your own model layer so you can change prompts, providers, and safety rules independently.
15. Apify BaZi Chart API: best pay-per-chart automation experiment
The Apify BaZi Chart API is a community Actor built on the lunar-typescript library. It returns the pillars, Hidden Stems, Na Yin, Ten Gods, Five-Element distribution, Day Master strength, Luck Cycles, and current-year data in Traditional Chinese, Simplified Chinese, or English.
Its input includes an IANA timezone, solar or lunar calendar selection, Zi-hour mode, and optional Luck Cycles. The listed Actor price is $10 per 1,000 charts, in addition to Apify platform and compute usage.
This is a convenient option for scheduled jobs, datasets, and teams already using Apify. It is not the same procurement choice as a specialist BaZi API with a public SLA, domain support, and a stable subscription contract. The Actor's behavior also depends on a community maintainer and an upstream calendar library.
Choose it for batch automation or a low-risk experiment. For a core customer-facing calculation, evaluate the underlying library and maintainer risk directly.
Also evaluated, but not ranked
The wider search found several products with a BaZi endpoint or developer page that did not yet provide enough public evidence for the main ranking.
- D8ly documents a BaZi endpoint, true-solar correction, a 100-request daily account limit, and a no-key MCP surface for deterministic calculations. We could not verify public paid pricing or a sufficiently detailed BaZi response schema.
- AUVYLO documents a Four Pillars endpoint and a free allowance of 100 requests per day. Its Starter and Pro tiers are both marked "Coming Soon," and the stated 99.9 percent SLA is a future target, so it does not yet offer a verifiable production upgrade path.
- DaoTiming exposes unusually detailed personal charts and time-slice data for quantitative workflows. It costs $500 per quarter, explicitly uses clock time without true-solar correction, and is better understood as a specialized metaphysics data product than a general BaZi API.
- Tianjiyao documents Four Pillars, Hidden Stems, element analysis, structure, useful and avoid Gods, luck, and optional AI output. Public plan terminology and production onboarding remain too ambiguous for a confident cost comparison.
- astrom8 lists Chinese BaZi and Korean Saju endpoints, but its free credits do not unlock BaZi and the $99 entry plan is difficult to justify for a BaZi-only use case.
- 6API offers ten trial calls and a detailed Chinese response, but the current documentation shows a plain HTTP endpoint, unclear commercial pricing, and legacy Python 2.7 examples. Those are avoidable security and maintenance risks.
WisdomOS and Muxuange also appeared in discovery searches, but we could not retrieve enough crawlable official endpoint and pricing documentation to evaluate them fairly. Absence from the ranking does not prove that a service is inaccurate. It means the public evidence was insufficient for this guide.
BaZi API boundary test suite
Do not validate a BaZi provider with one ordinary birthday. Use dates and locations that force its conventions to become visible.
| Test | What to send | What to verify |
|---|---|---|
| Li Chun boundary | Two timestamps immediately before and after the exact Li Chun instant | Whether the year pillar changes according to the documented boundary rule. |
| Solar-term month boundary | Two timestamps around a Jie solar term | Whether the month pillar changes at the astronomical term rather than a fixed Gregorian date. |
| Zi-hour boundary | 22:59, 23:01, 00:01, and 01:01 local time | Whether the day and hour pillars follow the selected midnight convention. |
| Historical DST | A birth during a past DST transition with an IANA timezone | Whether the local timestamp resolves to the correct historical UTC instant. |
| Longitude correction | The same civil time near the eastern and western edges of one timezone | Whether local mean or apparent solar time changes the hour pillar when expected. |
| Leap lunar month | A documented leap-month date | Whether lunar input is accepted, rejected clearly, or converted without losing the leap flag. |
| Unknown birth hour | Omit the hour or send the documented unknown value | Whether the hour pillar becomes null with a warning instead of a fabricated default. |
| Da Yun direction | Male and female fixtures across yin and yang year stems | Whether direction follows the documented school rule. |
| Da Yun start age | Births just before and after the next relevant solar term | Whether the start age is calculated rather than hard-coded. |
| Localization parity | Request the same chart in every required language | Whether identifiers remain stable while display text changes. |
Store the provider version, request, response, UTC instant, timezone database version if known, and applied conventions with every fixture. A screenshot of eight characters is not enough to debug a future discrepancy.
Hosted API, local MCP, or open-source BaZi engine?
If BaZi calculation is part of your team's expertise, a local package or self-hosted service can be more sustainable than a young hosted provider. The strongest open options found in this search cover several different integration styles.
| Project | License | Best use | Notable capabilities |
|---|---|---|---|
| OpenFate BaZi MCP | MIT | Local AI-agent tool | True solar time, Four Pillars, Ten Gods, Hidden Stems, Na Yin, growth stages, Da Yun, interactions, and policy metadata through local stdio MCP. |
| Chinese Metaphysics Platform | MIT | Self-hosted Python API | FastAPI chart, analysis, fortune, and compatibility routes with optional true-solar correction and a 1900 to 2100 range. |
yuhr123/bazi | ISC | TypeScript, Cloudflare Worker, or MCP | HTTP and MCP interfaces, Zi-hour sect controls, Shen Sha, Da Yun, and stem and branch interactions. |
lunar-python and lunar-typescript | MIT | Embedding a calendar engine | Solar terms, Gan-Zhi, BaZi, Five Elements, Ten Gods, Na Yin, and broader Chinese calendar data. |
| Stellium | AGPL-3.0 | Multi-tradition astrology library | BaZi alongside Western and Vedic calculations, with structured and visual output. Review AGPL obligations before network deployment. |
OpenFate is particularly interesting for a local AI application because it supplies deterministic BaZi facts through MCP without depending on a hosted chart endpoint. It is not a public HTTP API, so it belongs in an agent runtime or local service architecture rather than a browser-only app.
Self-hosting removes per-request fees and reduces vendor availability risk. It replaces them with engineering obligations:
- You own timezone, historical DST, longitude correction, and convention decisions.
- You must create and maintain regression fixtures around solar-term and Zi-hour boundaries.
- You need your own stable API schema, localization layer, monitoring, and support process.
- Interpretive layers such as Day Master strength, Yong Shen, Shen Sha, compatibility, and forecast flows may require additional rules beyond the base calendar library.
Use a library when calendar calculation is part of your core expertise. Use a local MCP when an agent needs deterministic tools on the same machine. Use a hosted API when you want a documented contract, production operations, specialized analysis, and a faster path to a customer-facing feature.
Final recommendation
Choose FreeAstroAPI for the best overall balance of BaZi depth, auditable time correction, related Chinese astrology endpoints, free access, and predictable production pricing.
Choose RoxyAPI if your application needs users or practitioners to select a BaZi school explicitly. Its convention object is the clearest technical design in this comparison.
Choose OpenEphemeris for the clearest published validation evidence and chart rendering. Choose FateAPI for modern, versioned Chinese-first infrastructure, Yuanfenju for a mature Chinese metaphysics catalog, or SAZU for the deepest Korean-first hosted product in this survey.
Choose Saju API for an inexpensive Korean and Chinese product, Vedika for multilingual sandbox testing, 14 Main Stars for a no-signup basic chart, and Ablecity for contract-based Korean Saju workflows. OpenFate is the strongest local MCP option. Consider AstroWay only after testing its recently corrected boundary logic against your own fixtures.
The most important decision is not the rank. It is whether the provider documents the exact time and boundary rules your product promises to use. A cheap chart that silently applies the wrong convention is more expensive to fix than a well-specified API.
Frequently asked questions
What is the best BaZi API in 2026?
FreeAstroAPI is the best overall BaZi API for most developers because it combines deep Four Pillars output, three time-standard modes, Shen Sha, interactions, professional analysis, a permanent free tier, and paid plans starting at $8 per month. RoxyAPI is better when explicit school-convention selection is the main requirement.
Is there a free BaZi API?
Yes. FreeAstroAPI provides 80 requests per day, Saju API provides 3,000 requests per month with a 100-per-day cap, 14 Main Stars provides a no-key basic chart at 20 requests per minute, AstroWay provides 10,000 credits that equal about 1,000 BaZi calls, and Astrology-API.io provides 50 calls per month. Vedika and SAZU offer restricted sandboxes rather than free arbitrary-input production allowances. OpenEphemeris provides 150 one-time credits, and FateAPI starts a workspace with 5,000 calls.
What is the difference between BaZi and Saju?
BaZi is the Chinese name for Four Pillars of Destiny, while Saju is the Korean tradition and terminology for a closely related Four Pillars system. The calculation core overlaps, but labels, interpretation rules, midnight conventions, local-time practices, supporting stars, and product expectations can differ.
Does a BaZi API need true solar time?
Not every school uses apparent true solar time, but an API should document whether it uses civil clock time, local mean time, or apparent solar time. This matters most when time correction moves a birth across a two-hour branch or a day boundary.
Which BaZi API has the best free tier?
Saju API has the largest clearly recurring arbitrary-input allowance at 3,000 requests per month, subject to 100 calls per day. FreeAstroAPI's free tier is smaller at 80 per day but includes a broader BaZi feature set, commercial use, hosted MCP, and a direct paid path. 14 Main Stars requires no signup but returns a much smaller BaZi object and offers no SLA.
Which BaZi API publishes the strongest validation evidence?
OpenEphemeris publishes the most inspectable provider validation found in this survey: a 56-case canonical suite covering year pillars, Ten God matrices, Hidden Stems, Na Yin, and other rules. It is still provider-published evidence, not an independent certification. Production teams should rerun their own boundary fixtures.
Which API is best for Chinese, Korean, or Japanese BaZi terminology?
FateAPI is the strongest modern Chinese-first choice and maps stable terminology into Simplified Chinese, Traditional Chinese, English, Japanese, and Korean. Yuanfenju is the stronger established Chinese catalog. SAZU is the deepest Korean-first Saju service, while Neo Bazi Solutions is the most specifically Japanese API in this comparison. Verify practitioner terminology with a native-domain reviewer before publishing readings.
Can I build a BaZi calculator in Python without an API?
Yes. lunar-python, lunar-typescript, Stellium, and the Chinese Metaphysics Platform can calculate BaZi data locally. OpenFate supplies a local BaZi MCP server for agent workflows. You will still need to choose and document timezone handling, solar-time correction, year and day boundaries, Luck Cycle rules, interpretation layers, and a stable response schema.
For an implementation walkthrough, see How to Calculate BaZi Four Pillars in Python. To inspect the complete hosted response, start with the BaZi API documentation.