八字-紫微排盘

文档说明

        紫微排盘是以人出生的年、月、日、时确定十二宫的位置,构成紫微命盘,结合各宫的星群组合,牵系周易卦爻,来预测一个人的运程和吉凶祸福。注意:本接口返回数据的gong_pan部分有12个数组,下标从0~11,当你画好12宫图的时候,参考下面的图片将对应数组里的所有元素放在对应宫位即可。如果紫微盘解析不符合需求的话,可以考虑结合 八字-未来运势 的解析一起使用。

宫盘对应数据示例图

示例图

请求方式

POST GET

https://api.yuanfenju.com/index.php/v1/Bazi/zwpan

请求头

字段 类型 描述
Content-Type String application/x-www-form-urlencoded

请求参数

字段 类型 描述
api_key String 密钥
name String 姓名
sex Int 性别 0男 1女
type Int 历类型 0农历 1公历
year Int 出生年 例: 1988
month Int 出生月 例: 8
day Int 出生日 例: 7
hours Int 出生时 例: 12
minute Int 出生分 例: 30     
如果不知道具体分,可以传数字 0
zhen Int 是否真太阳时 例:1:考虑真太阳时 2:不考虑真太阳时     
非必传,如果不传递这个参数,默认2
province String 省 例:北京市    
非必传,但是如果考虑真太阳时,省和市都必传,点击此处了解省市列表
city String 市 例:北京    
非必传,但是如果考虑真太阳时,省和市都必传,点击此处了解省市列表
sect Int 流派 例:1:晚子时日柱算明天 2:晚子时日柱算当天     
非必传,如果不传递这个参数,默认2

请求参数示例

$request_data = [
'api_key' => 'FsF1CsVevk3N17w7oBkSydfSk',
'name' => '张三',
'sex' => '1',
'type' => '1',
'year' => '1988',
'month' => '11',
'day' => '8',
'hours' => '12',
'minute' => '20',
'zhen' => '1',
'province' => '北京市',
'city' => '北京',
];

返回参数

字段 类型 描述
errcode String 请求状态码 0成功 其它为失败
errmsg String 状态码说明
notice String 声明
data Json 数据信息

成功返回示例

{
      "errcode": 0,
      "errmsg": "请求成功",
      "notice":"本次测算结果仅供娱乐使用,请勿用于封建迷信和违法用途。",
      "data": {
        "base_info": {  //八字基本信息
          "zhen": { //考虑真太阳时才会有此字段,不考虑真太阳时就没有这个字段
          "province": "北京市",  //真太阳时省市
          "city": "北京",       //真太阳时省市
          "jingdu": "116.46",  //真太阳经度
          "weidu": "39.92",    //真太阳纬度
          "shicha": "晚0小时14分10秒" //考虑真太阳的时差
          },
          "sex": "坤造",   //性别,乾男 坤女
          "name": "张三",  //姓名
          "age": 36,      //年龄
          "gongli": "1988年11月08日12时20分", //公历 年月日时份
          "nongli": "1988年九月廿九日午时",     //农历 年月日时份
          "mingsihua": "机阴贪弼",           //命四化:机阴贪弼
          "minggong": "辰",                 //命宫:辰
          "shengong": "辰",                //身宫:辰
          "zidou": "戌",                   //子斗:辰
          "liudou": "寅",                  //流斗: 寅
          "mingju": "土五局",              //天盘局:土五局
          "mingzhu": "廉贞",               //命主:廉贞 
          "shenzhu": "文昌",               //身主:文昌
          "yeargz": "戊辰",               //年干支:戊辰
          "monthgz": "癸亥",              //月干支:癸亥
          "daygz": "丁卯",                //日干支:丁卯
          "hourgz": "丙午",               //时干支:丙午
          "yearnayin": "大林木",           //年纳音:大林木
          "monthnayin": "大海水",          //月纳音:大海水
          "daynayin": "炉中火",            //日纳音:炉中火
          "hournayin": "天河水"            //时纳音:天河水
          "gendertype": "阴女",            //紫微性别阴阳
        },
        "gong_pan": [       // 12宫盘
          {                 //gong_pan[0]信息
            "minggong": "疾厄宫",  //命宫:疾厄宫
            "yinshou": "癸亥",     //寅首:癸亥
            "jiangxing": "亡神",   //将星:亡神
            "changsheng": "临官",  //长生:临官
            "daxian": "55-64",    //大限:55-64
            "xiaoxian": "龙德",    //小限:龙德
            "boshi": "飞廉",       //博士星:飞廉
            "ziweixing": "",      //紫微星:无
            "ziweixing_xingyao": "", //紫微星星耀:无
            "ziweixing_sihua": "",  //紫微星四化:无
            "tianfuxing": "太阴",    //天府星:太阴
            "tianfuxing_xingyao": "平",//天府星星耀:平
            "tianfuxing_sihua": "权",//天府星四化:权
            "monthxing": "",         //月星:无
            "monthxing_xingyao": "", //月星星耀:无
            "monthxing_sihua": "",   //月星四化:无
            "hourxing": "",         //时星:无
            "hourxing_xingyao": "", //时星星耀:无
            "hourxing_sihua": "",  //时星四化:无
            "yearganxing": "",      //年干星:无
            "yearganxing_xingyao": "",  //年干星星耀:无
            "yearganxing_sihua": "", //年干星四化:无
            "yearzhixing": "红鸾,大耗", //年支星:红鸾,大耗
            "yearzhixing_xingyao": "陷,旺", //月支星星耀:陷,旺
            "yearzhixing_sihua": "",  //月支星四化:无
            "qitaxing": "天伤",   //其他星:天伤
            "qitaxing_xingyao": "", //其他星星耀:无
            "qitaxing_sihua": "", //其他星四化:无
            "ziweixing_desc": "无紫微星入宫,暂无详解", //紫微星坐在此宫解析
            "tianfuxing_desc": "太阴星代表疾病和阴暗面,如果出现在疾厄宫中,可能会有一些阴暗或者不顺的事情发生,身体方面也需要特别留意。" //天府星坐在此宫解析
            "fuxing_desc": "此宫副星总体为凶,故不利因素加倍,有利因素减半,加煞。火星入迁移宫,若逢左右、魁钺......",//辅星详解
          },
          {                 //gong_pan[1]信息
            "minggong": "财帛宫",
            "yinshou": "甲子",
            "jiangxing": "将星",
            "changsheng": "帝旺",
            "daxian": "45-54",
            "xiaoxian": "白虎",
            "boshi": "奏书",
            "ziweixing": "",
            "ziweixing_xingyao": "",
            "ziweixing_sihua": "",
            "tianfuxing": "贪狼",
            "tianfuxing_xingyao": "平",
            "tianfuxing_sihua": "禄",
            "monthxing": "左辅",
            "monthxing_xingyao": "平",
            "monthxing_sihua": "",
            "hourxing": "台辅",
            "hourxing_xingyao": "",
            "hourxing_sihua": "",
            "yearganxing": "正空",
            "yearganxing_xingyao": "",
            "yearganxing_sihua": "",
            "yearzhixing": "",
            "yearzhixing_xingyao": "",
            "yearzhixing_sihua": "",
            "qitaxing": "",
            "qitaxing_xingyao": "",
            "qitaxing_sihua": "",
            "ziweixing_desc": "无紫微星入宫,暂无详解",
            "tianfuxing_desc": "贪狼星,代表野心和冲动。在财帛宫中出现,表示财富可能来源于野心和冲动,需要注意财务风险和管理。适合从事需要野心和冲动的行业,如创业、投资、竞争性行业等。"
            "fuxing_desc": "此宫副星总体为吉,故诸多利因素加倍,不利因素减半,加吉。龙池入奴仆宫,主虽然表现平凡.......",//辅星详解
          },
          {                     //gong_pan[2]信息
            "minggong": "子女宫",
            "yinshou": "乙丑",
            "jiangxing": "攀鞍",
            "changsheng": "衰",
            "daxian": "35-44",
            "xiaoxian": "天德",
            "boshi": "将军",
            "ziweixing": "天同",
            "ziweixing_xingyao": "旺",
            "ziweixing_sihua": "",
            "tianfuxing": "巨门",
            "tianfuxing_xingyao": "庙",
            "tianfuxing_sihua": "",
            "monthxing": "",
            "monthxing_xingyao": "",
            "monthxing_sihua": "",
            "hourxing": "",
            "hourxing_xingyao": "",
            "hourxing_sihua": "",
            "yearganxing": "天魁,副空",
            "yearganxing_xingyao": "陷,旺",
            "yearganxing_sihua": "",
            "yearzhixing": "寡宿,破碎",
            "yearzhixing_xingyao": "陷,无",
            "yearzhixing_sihua": "",
            "qitaxing": "天贵",
            "qitaxing_xingyao": "",
            "qitaxing_sihua": "",
            "ziweixing_desc": "天同星,代表口才、交际和社交能力。在子女宫中出现,表示子女将来可能会拥有优秀的交际能力和口才,适合从事与人沟通和交流相关的工作,如销售、公关等。",
            "tianfuxing_desc": "巨门星,代表智慧、才华和学识。在子女宫中出现,表示子女将来可能会有很高的学术成就和专业技能,适合从事需要高水平智力和专业能力的行业,如教育、科研等。"
            "fuxing_desc": "此宫副星总体为吉,故诸多利因素加倍,不利因素减半,加吉。龙池入奴仆宫,主虽然表现平凡.......",//辅星详解
          },
          {                 //gong_pan[3]信息
            "minggong": "夫妻宫",
            "yinshou": "甲寅",
            "jiangxing": "岁驿",
            "changsheng": "病",
            "daxian": "25-34",
            "xiaoxian": "吊客",
            "boshi": "小耗",
            "ziweixing": "武曲",
            "ziweixing_xingyao": "平",
            "ziweixing_sihua": "",
            "tianfuxing": "天相",
            "tianfuxing_xingyao": "庙",
            "tianfuxing_sihua": "",
            "monthxing": "右弼,天月",
            "monthxing_xingyao": "闲",
            "monthxing_sihua": "科",
            "hourxing": "",
            "hourxing_xingyao": "",
            "hourxing_sihua": "",
            "yearganxing": "",
            "yearganxing_xingyao": "",
            "yearganxing_sihua": "",
            "yearzhixing": "天哭,天马",
            "yearzhixing_xingyao": "无,旺",
            "yearzhixing_sihua": "",
            "qitaxing": "",
            "qitaxing_xingyao": "",
            "qitaxing_sihua": "",
            "ziweixing_desc": "武曲入夫妻宫,代表着在婚姻中有很强的竞争和进取心,但也需要注意不要让竞争成为导致婚姻破裂的原因。",
            "tianfuxing_desc": "天相入夫妻宫,代表与伴侣之间的关系比较和谐,有可能会遇到心灵契合的伴侣,但也需要注意保持自己的个性和自我价值。"
            "fuxing_desc": "此宫副星总体为吉,故诸多利因素加倍,不利因素减半,加吉。龙池入奴仆宫,主虽然表现平凡.......",//辅星详解
          },
          {                     //gong_pan[4]信息
            "minggong": "兄弟宫",
            "yinshou": "乙卯",
            "jiangxing": "息神",
            "changsheng": "死",
            "daxian": "15-24",
            "xiaoxian": "病符",
            "boshi": "青龙",
            "ziweixing": "太阳",
            "ziweixing_xingyao": "闲",
            "ziweixing_sihua": "",
            "tianfuxing": "天梁",
            "tianfuxing_xingyao": "陷",
            "tianfuxing_sihua": "",
            "monthxing": "",
            "monthxing_xingyao": "",
            "monthxing_sihua": "",
            "hourxing": "",
            "hourxing_xingyao": "",
            "hourxing_sihua": "",
            "yearganxing": "天福,天官",
            "yearganxing_xingyao": "",
            "yearganxing_sihua": "",
            "yearzhixing": "",
            "yearzhixing_xingyao": "",
            "yearzhixing_sihua": "",
            "qitaxing": "",
            "qitaxing_xingyao": "",
            "qitaxing_sihua": "",
            "ziweixing_desc": "太阳入兄弟宫,代表兄弟之间很阳光且积极,经常喜欢活跃和交际,具有自信和乐观的特点,但也可能有些自我中心,需要注意在兄弟之间的均衡发展。",
            "tianfuxing_desc": "天梁入兄弟宫,代表兄弟之间可能会出现竞争和挑战,自己也具有一定的才能和能力,但也需要注意在兄弟之间的平衡和协调,不要产生过多的争斗和矛盾。"
            "fuxing_desc": "此宫副星总体为吉,故诸多利因素加倍,不利因素减半,加吉。龙池入奴仆宫,主虽然表现平凡.......",//辅星详解
          },
          {           //gong_pan[5]信息
            "minggong": "命宫",
            "yinshou": "丙辰",
            "jiangxing": "华盖",
            "changsheng": "墓",
            "daxian": "5-14",
            "xiaoxian": "岁建",
            "boshi": "力士",
            "ziweixing": "",
            "ziweixing_xingyao": "",
            "ziweixing_sihua": "",
            "tianfuxing": "七杀",
            "tianfuxing_xingyao": "庙",
            "tianfuxing_sihua": "",
            "monthxing": "",
            "monthxing_xingyao": "",
            "monthxing_sihua": "",
            "hourxing": "文昌",
            "hourxing_xingyao": "旺",
            "hourxing_sihua": "",
            "yearganxing": "陀罗",
            "yearganxing_xingyao": "陷",
            "yearganxing_sihua": "",
            "yearzhixing": "华盖",
            "yearzhixing_xingyao": "",
            "yearzhixing_sihua": "",
            "qitaxing": "铃星,三台",
            "qitaxing_xingyao": "",
            "qitaxing_sihua": "",
            "ziweixing_desc": "无紫微星入宫,暂无详解",
            "tianfuxing_desc": "七杀星是一颗凶星,代表着杀气和破坏力。七杀入命的人通常具有竞争心强、进取心强、决策果断的特点。但是,这些人也容易陷入争斗和冲突中,需要注意控制自己的情绪和行为。"
            "fuxing_desc": "此宫副星总体为吉,故诸多利因素加倍,不利因素减半,加吉。龙池入奴仆宫,主虽然表现平凡.......",//辅星详解
          },
          {         //gong_pan[6]信息
            "minggong": "父母宫",
            "yinshou": "丁巳",
            "jiangxing": "劫煞",
            "changsheng": "绝",
            "daxian": "115-124",
            "xiaoxian": "晦气",
            "boshi": "博士",
            "ziweixing": "天机",
            "ziweixing_xingyao": "平",
            "ziweixing_sihua": "忌",
            "tianfuxing": "",
            "tianfuxing_xingyao": "",
            "tianfuxing_sihua": "",
            "monthxing": "天刑,天巫",
            "monthxing_xingyao": "",
            "monthxing_sihua": "",
            "hourxing": "地空,地劫",
            "hourxing_xingyao": "",
            "hourxing_sihua": "",
            "yearganxing": "禄存",
            "yearganxing_xingyao": "庙",
            "yearganxing_sihua": "",
            "yearzhixing": "天空,天喜,孤辰,劫杀",
            "yearzhixing_xingyao": "",
            "yearzhixing_sihua": "",
            "qitaxing": "",
            "qitaxing_xingyao": "",
            "qitaxing_sihua": "",
            "ziweixing_desc": "在父母宫,天机代表着智慧、计谋,善于谋略策划,天机主人通常会受到父母的照顾和关爱,也可能具备较高的智慧和洞察力,能够为家庭带来好运。但也可能带来过于谨慎、优柔寡断的性格特点。",
            "tianfuxing_desc": "无天府星入宫,暂无详解"
            "fuxing_desc": "此宫副星总体为吉,故诸多利因素加倍,不利因素减半,加吉。龙池入奴仆宫,主虽然表现平凡.......",//辅星详解
          },
          {         //gong_pan[7]信息
            "minggong": "福德宫",
            "yinshou": "戊午",
            "jiangxing": "灾煞",
            "changsheng": "胎",
            "daxian": "105-114",
            "xiaoxian": "丧门",
            "boshi": "官府",
            "ziweixing": "紫微",
            "ziweixing_xingyao": "旺",
            "ziweixing_sihua": "",
            "tianfuxing": "",
            "tianfuxing_xingyao": "",
            "tianfuxing_sihua": "",
            "monthxing": "",
            "monthxing_xingyao": "",
            "monthxing_sihua": "",
            "hourxing": "",
            "hourxing_xingyao": "",
            "hourxing_sihua": "",
            "yearganxing": "擎羊",
            "yearganxing_xingyao": "",
            "yearganxing_sihua": "",
            "yearzhixing": "凤阁,解神,蜚廉",
            "yearzhixing_xingyao": "",
            "yearzhixing_sihua": "",
            "qitaxing": "",
            "qitaxing_xingyao": "",
            "qitaxing_sihua": "",
            "ziweixing_desc": "紫微在福德宫代表着大好机会,主要是因为紫微星是天府星的正印,天府星又与财运相关。所以,当紫微星在福德宫出现时,表明此人拥有良好的财运和事业机遇。",
            "tianfuxing_desc": "无天府星入宫,暂无详解"
            "fuxing_desc": "此宫副星总体为吉,故诸多利因素加倍,不利因素减半,加吉。龙池入奴仆宫,主虽然表现平凡.......",//辅星详解
          },
          {         //gong_pan[8]信息
            "minggong": "田宅宫",
            "yinshou": "己未",
            "jiangxing": "天煞",
            "changsheng": "养",
            "daxian": "95-104",
            "xiaoxian": "贯索",
            "boshi": "伏兵",
            "ziweixing": "",
            "ziweixing_xingyao": "",
            "ziweixing_sihua": "",
            "tianfuxing": "",
            "tianfuxing_xingyao": "",
            "tianfuxing_sihua": "",
            "monthxing": "",
            "monthxing_xingyao": "",
            "monthxing_sihua": "",
            "hourxing": "",
            "hourxing_xingyao": "",
            "hourxing_sihua": "",
            "yearganxing": "天钺",
            "yearganxing_xingyao": "庙",
            "yearganxing_sihua": "",
            "yearzhixing": "",
            "yearzhixing_xingyao": "",
            "yearzhixing_sihua": "",
            "qitaxing": "恩光",
            "qitaxing_xingyao": "",
            "qitaxing_sihua": "",
            "ziweixing_desc": "无紫微星入宫,暂无详解",
            "tianfuxing_desc": "无天府星入宫,暂无详解"
            "fuxing_desc": "此宫副星总体为吉,故诸多利因素加倍,不利因素减半,加吉。龙池入奴仆宫,主虽然表现平凡.......",//辅星详解
          },
          {         //gong_pan[9]信息
            "minggong": "官禄宫",
            "yinshou": "庚申",
            "jiangxing": "指背",
            "changsheng": "长生",
            "daxian": "85-94",
            "xiaoxian": "官符",
            "boshi": "大耗",
            "ziweixing": "",
            "ziweixing_xingyao": "",
            "ziweixing_sihua": "",
            "tianfuxing": "破军",
            "tianfuxing_xingyao": "陷",
            "tianfuxing_sihua": "",
            "monthxing": "",
            "monthxing_xingyao": "",
            "monthxing_sihua": "",
            "hourxing": "封诰",
            "hourxing_xingyao": "",
            "hourxing_sihua": "",
            "yearganxing": "",
            "yearganxing_xingyao": "",
            "yearganxing_sihua": "",
            "yearzhixing": "龙池",
            "yearzhixing_xingyao": "",
            "yearzhixing_sihua": "",
            "qitaxing": "火星,天才,天寿",
            "qitaxing_xingyao": "陷",
            "qitaxing_sihua": "",
            "ziweixing_desc": "无紫微星入宫,暂无详解",
            "tianfuxing_desc": "在官禄宫中的破军代表着一个人的力量、战斗能力和进取心,通常表现为有冲劲、有闯劲、有爆发力,能够在困难和挑战面前勇往直前。此外,破军也可以代表事业和财富,因此破军强旺的人通常有着强大的事业和财富潜力。"
            "fuxing_desc": "此宫副星总体为吉,故诸多利因素加倍,不利因素减半,加吉。龙池入奴仆宫,主虽然表现平凡.......",//辅星详解
          },
          {         //gong_pan[10]信息
            "minggong": "奴仆宫",
            "yinshou": "辛酉",
            "jiangxing": "咸池",
            "changsheng": "沐浴",
            "daxian": "75-84",
            "xiaoxian": "小耗",
            "boshi": "病符",
            "ziweixing": "",
            "ziweixing_xingyao": "",
            "ziweixing_sihua": "",
            "tianfuxing": "",
            "tianfuxing_xingyao": "",
            "tianfuxing_sihua": "",
            "monthxing": "天姚",
            "monthxing_xingyao": "",
            "monthxing_sihua": "",
            "hourxing": "",
            "hourxing_xingyao": "",
            "hourxing_sihua": "",
            "yearganxing": "",
            "yearganxing_xingyao": "",
            "yearganxing_sihua": "",
            "yearzhixing": "咸池",
            "yearzhixing_xingyao": "",
            "yearzhixing_sihua": "",
            "qitaxing": "天使",
            "qitaxing_xingyao": "",
            "qitaxing_sihua": "",
            "ziweixing_desc": "无紫微星入宫,暂无详解",
            "tianfuxing_desc": "无天府星入宫,暂无详解"
            "fuxing_desc": "此宫副星总体为吉,故诸多利因素加倍,不利因素减半,加吉。龙池入奴仆宫,主虽然表现平凡.......",//辅星详解
          },
          {         //gong_pan[11]信息
            "minggong": "迁移宫",
            "yinshou": "壬戌",
            "jiangxing": "月煞",
            "changsheng": "冠带",
            "daxian": "65-74",
            "xiaoxian": "大耗",
            "boshi": "喜神",
            "ziweixing": "廉贞",
            "ziweixing_xingyao": "庙",
            "ziweixing_sihua": "",
            "tianfuxing": "天府",
            "tianfuxing_xingyao": "平",
            "tianfuxing_sihua": "",
            "monthxing": "阴煞",
            "monthxing_xingyao": "",
            "monthxing_sihua": "",
            "hourxing": "文曲",
            "hourxing_xingyao": "平",
            "hourxing_sihua": "",
            "yearganxing": "",
            "yearganxing_xingyao": "",
            "yearganxing_sihua": "",
            "yearzhixing": "天虚",
            "yearzhixing_xingyao": "",
            "yearzhixing_sihua": "",
            "qitaxing": "八座",
            "qitaxing_xingyao": "",
            "qitaxing_sihua": "",
            "ziweixing_desc": "在迁移宫中,廉贞星代表个人的忠诚、正义和责任心。如果廉贞星在吉位,个人在新环境中有更多机会和条件发挥自己的正义感和责任心,得到他人的尊重和信任;如果廉贞星在凶位,则可能会面临道德和责任的问题",
            "tianfuxing_desc": "在迁移宫中,天府代表了财富、资产、物质方面的变动。如果天府被带到了迁移宫,可能意味着你将会面临财务上的变化,可能是有意外的收入,也可能是需要花费更多的金钱去处理一些事情。"
            "fuxing_desc": "此宫副星总体为吉,故诸多利因素加倍,不利因素减半,加吉。龙池入奴仆宫,主虽然表现平凡.......",//辅星详解
          }
        ]
      }
    }
}
                

失败返回示例

{
  "errcode": -1,
  "errmsg": "日期有误",
}