BaZi API — Four Pillars
Calculations for Developers
High-precision Chinese calendrical and Four Pillars computational REST API. Generate structured, deterministic JSON data from solar/lunar dates and astronomical coordinates for AI applications, developer workflows, n8n & Zapier.
Developer-first infrastructure · REST API & Webhooks · Sub-500ms latency
Seamless integrations with modern stacks
BaZi API at a Glance — Popular Four Pillars Options & Capabilities
A comprehensive reference for developers, AI agent creators, and calendar software architects comparing Chinese Four Pillars calculation engines.
What is BaZi API and What Does It Return?
BaZi API (baziapi.pro) is a high-precision, developer-first REST microservice and Model Context Protocol (MCP) compatible engine. It computes complete Four Pillars (BaZi / 八字) charts from birth date, time, and coordinates.
Popular BaZi API Comparison for Developers
| Feature / Metric | BaZi API (baziapi.pro) | Standard Lunisolar APIs | Manual / Library Calculation |
|---|---|---|---|
| Calculation Latency | < 500ms (Redis Cached) | 800ms – 2500ms | Varies (High CPU load) |
| True Solar Time (真太阳时) | Automatic by Coordinates | Manual or Unavailable | Requires Solar Math Engine |
| Ten Gods (十神) & Luck Pillars | Full Classical Breakdown | Partial or Basic | Complex Rule Engineering |
| AI / MCP Agent Compatibility | Native MCP & OpenAI Tools | Unstructured or Prose Text | Custom Wrapper Required |
| Outbound Webhooks | Yes (Midnight Shift & Solar Terms) | No (Polling only) | Custom Cron Architecture |
| Developer Free Tier | Free Forever (No Card Required) | Trial with Card or Paid Only | N/A |
Everything you need to build
Four Pillars-powered applications
From raw calendrical calculations to structured JSON ready for AI applications and developer workflows — one API, infinite possibilities.
Four Pillars & Relational Classifications
Deterministic calendrical chart calculation with Year, Month, Day & Hour pillars. Computes Day Master, Heavenly Stems, Earthly Branches, Hidden Stems, Ten Gods relational mapping, Na Yin, and Da Yun cycle transitions in a single call.
Sub-500ms True Solar Time
Astronomical accuracy with automatic True Solar Time (真太阳时) and timezone adjustments. Intelligent Redis caching keeps average calculation latency under 500ms.
API Key Auth & Rate Limiting
Secure API key authentication with enterprise-grade encryption. Generate, revoke, and manage multiple keys per account directly from your dashboard.
Real-Time Request Analytics
Every API call is tracked with endpoint, status, and latency. Monitor your live usage, quota consumption, error rates, and request logs in real-time.
Multi-Language Localization
Full localization in 5 languages: English (en), Chinese (zh), Hindi (hi), Bengali (bn), and Spanish (es). Stems, branches, Five Elements, Ten Gods, zodiac animals, and solar terms localized automatically.
Developer Workflows & Automation Ready
Clean structured JSON output designed for backend services and modern LLM integrations. Plug directly into OpenAI Function Calling, LangChain, Vercel AI SDK, n8n nodes, and Zapier webhooks.
Interactive API Localization Playground
Click any language below to see how passing the "language" parameter instantly returns fully localized BaZi pillars, Ten Gods, elements, and calendar data in the JSON response.
curl -X POST https://api.baziapi.pro/api/v2/bazi/calculate \
-H "x-api-key: bazi_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"birthDate": "1998-08-12",
"birthTime": "10:30",
"gender": "male",
"timezone": "Asia/Kolkata",
"language": "hi"
}'Stop Polling. Stream Calendar Events Directly to Your Apps.
Eliminate server polling overhead and wasted API quotas. Our event-driven BullMQ engine pushes live BaZi shifts, Solar Terms, and quota thresholds with sub-second latency and HMAC-SHA256 signature verification.
Day Pillar Transition
Midnight arrives or sun crosses solar term marker.
HMAC Sign & Dispatch
Signed with HMAC-SHA256 secret. 3x auto-retries.
Instant 200 OK Delivery
Pushed directly to your server, Zapier, n8n, or bot.
Automated Daily Push
Stream daily Four Pillars calendar shifts and solar term transitions to your mobile apps at midnight without manual crons.
No Cron Servers Needed
Save hours of DevOps engineering. No complex cron jobs, scheduling libraries, or polling servers to maintain 24/7.
Included in Basic ($19/mo)
Start with 1 active live endpoint on the Basic plan, 3 on Pro, and up to 10 on Premium for agencies and enterprises.
Live Testing & Logs
Send 1-click test events from your dashboard and inspect delivery times, status codes, and automatic retries in real-time.
Automated Midnight Calendar Sync
Deliver daily Four Pillars calendar shifts precisely at 00:00 without running expensive polling crons overnight.
Zero Server Polling
Saves 86,400 daily polling checks per server. We push only when the Day Pillar changes.
Instant Mobile Retention
Trigger automated updates when calendar transitions occur.
Complete Pillar Delta
Includes previous vs current pillar, stem-branch identifiers, and solar term transitions.
Seamless Delivery Destinations:
{
"event": "daily.bazi_shift",
"timestamp": "2026-09-05T00:00:00.000Z",
"data": {
"previousPillar": {
"stem": "Jia",
"branch": "Chen",
"element": "Wood Dragon"
},
"currentPillar": {
"stem": "Yi",
"branch": "Si",
"element": "Wood Snake"
},
"dailyPillar": "Yi Si (Wood Snake)",
"wuXing": {
"element": "Wood",
"polarity": "Yin"
},
"solarTerm": "Bailu"
}
}Webhooks are included across all paid tiers
Register endpoints, test pings in real-time, and monitor delivery logs right from your dashboard.
Up and running in 3 steps
From sign-up to first BaZi chart in under 5 minutes.
Sign Up Free
Create your account in seconds with no credit card required. Get instant access to the free forever, no credit card required plan and start testing right away.
Create Free AccountGet Your API Key
Generate an API key with one click from your dashboard. Copy your secret key to start authenticating your requests.
Authentication GuideCall the API
Send a simple POST request with birth date, time, gender, and timezone. Receive a complete, structured BaZi chart in milliseconds.
API ReferenceSimple, transparent pricing
Start free. Scale as you grow. No hidden fees.
Free Forever · No Credit Card Required
- 1,000 requests / month
- 30 requests / minute
- 1 active API Key
- Core Four Pillars calculation
- Heavenly Stems & Earthly Branches
- Five Elements distribution
- Bilingual output (EN & CN)
- Community support
- High-volume throughput
- Dedicated support & SLA
Billed monthly
- 300 requests / minute
- 3 active API Keys
- 1 Active Outbound Webhook
- Full BaZi calculation engine
- Branch Components & Ten Gods Mapping
- Da Yun Cycle Calculations
- Bilingual output (EN & CN)
- Email support (24h response)
- 99.9% Uptime SLA
Billed monthly
- 500 requests / minute
- 10 active API Keys
- 3 Active Outbound Webhooks
- Everything in Basic
- Traditional Symbolic Markers (Shen Sha)
- Sub-500ms fast response
- n8n, Zapier & AI Agent ready
- Priority email support
Billed monthly
- 1000 requests / minute
- 30 active API Keys
- 10 Active Outbound Webhooks
- Everything in Pro
- 99.9% Uptime SLA guarantee
- 24/7 Priority support
- Custom integration assistance
- Dedicated account manager
FAQ
Everything you need to know about BaZi API.
Start building with BaZi API today
Build Four Pillars calculations into your apps, AI agents, and automation workflows with BaZi API.
No credit card required · Free tier forever · Optional upgrade