✦ 紫微斗数 API ✦

紫微斗数排盘与命理解读 · 标准化 RESTful 接口
轻松集成紫微命理功能到您的网站、APP 或小程序
🔄 RESTful API 🔑 Bearer Auth 📦 JSON ⚡ 即买即用
1 API 简介

本 API 提供完整的紫微斗数排盘能力,包括命盘计算、深度解读、每日运势、十年大限等功能。 基于 Node.js 排盘引擎驱动,所有命理计算均符合传统紫微斗数规则。

🌐
Base URL:https://ziweiapi.site
本地测试:http://127.0.0.1:8119
2 认证方式

所有 API 请求需要携带 Bearer Token 进行身份认证。 在 shop.html 购买套餐后获取 API Key。

# 请求头格式 Authorization: Bearer zw_your_api_key_here
⚠️
请注意:每个 API Key 有调用次数限制,超额后请求将被拒绝。请通过 /key/balance 接口查询剩余次数。
3 获取 API Key
1
选择套餐 — 根据调用量需求选择 Business API 或 White Label 方案
2
在线购买 — 选择套餐完成支付后即时获取 API Key
3
在请求头中添加 — 将 Key 作为 Authorization: Bearer <your_key> 发送
🛒 前往购买 API Key
4 接口列表
🔮 排盘 + 深度解读
POST /v1/paipan

完整的紫微斗数排盘与深度解读(3000+字)

📋 请求参数
参数类型必填说明
yearInteger出生年份(1900-2100)
monthInteger出生月份(1-12)
dayInteger出生日期(1-31)
hourInteger出生时辰(0-11,对应子时到亥时)
genderString性别:malefemale
styleString解读风格:modern(现代)/ classic(古典)/ poetic(诗意),默认 modern
📎 curl 示例
curl -X POST https://ziweiapi.site/v1/paipan \
-H "Authorization: Bearer zw_your_key" \
-H "Content-Type: application/json" \
-d '{
"year": 1995, "month": 8, "day": 15,
"hour": 6, "gender": "male",
"style": "modern"
}'
📤 返回示例
{
"success": true,
"data": {
"basic": {
"bazi": "乙亥 甲申 壬午 丙午",
"ming_gong": "寅",
"shen_gong": "子",
"yin_yang": "阳男"
},
"chart": [ ... ], // 12宫命盘数据
"daxian": [ ... ], // 十年大限
"reading": "..." // 解读全文
}
}
🧮 仅排盘(无解读)
POST /v1/paipan-only

纯排盘计算,返回命盘数据与大限,不消耗解读次数

📋 请求参数
参数类型必填说明
yearInteger出生年份
monthInteger出生月份
dayInteger出生日期
hourInteger出生时辰(0-11)
genderString性别:malefemale
📎 curl 示例
curl -X POST https://ziweiapi.site/v1/paipan-only \
-H "Authorization: Bearer zw_your_key" \
-H "Content-Type: application/json" \
-d '{
"year": 1990, "month": 3, "day": 21,
"hour": 4, "gender": "female"
}'
📤 返回示例
{
"success": true,
"data": {
"basic": { ... },
"chart": [ ... ], // 12宫命盘数据
"daxian": [ ... ] // 十年大限
}
}
🌅 每日运势
POST /v1/daily

基于命盘 + 流日推算,返回当日运势解读、幸运色、宜忌与空间建议

📋 请求参数
参数类型必填说明
yearInteger出生年份
monthInteger出生月份
dayInteger出生日期
hourInteger出生时辰(0-11)
genderString性别:malefemale
target_dateString指定日期,格式 YYYY-MM-DD,默认当天
📎 curl 示例
curl -X POST https://ziweiapi.site/v1/daily \
-H "Authorization: Bearer zw_your_key" \
-H "Content-Type: application/json" \
-d '{
"year": 1995, "month": 8, "day": 15,
"hour": 6, "gender": "male",
"target_date": "2026-05-16"
}'
📤 返回示例
{
"success": true,
"data": {
"date": "2026-05-16",
"lunar_date": "三月三十",
"reading": "今日...",
"lucky_color": "金色、白色",
"yi": ["签约", "社交", "学习"],
"ji": ["投机", "搬家"],
"orientation_advice": "..."
}
}
⏳ 十年大限
POST /v1/daxian

获取当前十年大限的详细信息与深度分析,了解大限运势起伏

📋 请求参数
参数类型必填说明
yearInteger出生年份
monthInteger出生月份
dayInteger出生日期
hourInteger出生时辰(0-11)
genderString性别:malefemale
ageInteger指定年龄的大限,不传则返回当前年龄的大限
📎 curl 示例
curl -X POST https://ziweiapi.site/v1/daxian \
-H "Authorization: Bearer zw_your_key" \
-H "Content-Type: application/json" \
-d '{
"year": 1988, "month": 12, "day": 1,
"hour": 2, "gender": "male",
"age": 38
}'
📤 返回示例
{
"success": true,
"data": {
"current_daxian": {
"palace": "财帛宫",
"age_range": "33-42",
"stars": ["武曲", "天府"],
"reading": "..."
},
"all_daxian": [ ... ] // 全部大限列表
}
}
5 定价方案
💡
计费说明:排盘+深度解读消耗 1 次调用,仅排盘消耗 0.5 次,每日运势消耗 1 次,十年大限消耗 5 次。
支持在线支付 · 购买后即时开通
🚀
准备集成紫微斗数到您的产品?

仅需 5 分钟即可完成 API 集成 · 先免费体验排盘效果
购买 Key 后即时生效,无需等待

🌟 免费体验排盘 🛒 购买 API Key
⚠️ 内容仅供娱乐参考,不构成专业建议