八字-八字精盘

文档说明

        八字精盘,亦称八字流盘,流盘数据非常精细,列出所有流年,流月详细信息,还可以通过工具-流日流时来列出精确到日时信息,包含十神,藏干,纳音,五行,自坐,星运,空亡,神煞,干支留意等非常多的详细信息。注意:该接口返回数据较大,不压缩的情况下有900多K数据,如果用户自己的服务器带宽过低可能会导致传输时间过长,建议5M以上带宽使用。(一般带宽的十分之一才是真实下载速度)

请求方式

POST GET

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

请求头

字段 类型 描述
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
sect Int 流派 例:1:晚子时日柱算明天 2:晚子时日柱算当天     
非必传,如果不传递这个参数,默认2
iszip Int 是否压缩数据 例:1:是 2:否     
非必传,如果不传递这个参数,默认2
因为八字精盘返回数据较大,因此考虑gzencode压缩数据以二进制形式返回,减少传输时间,
接收方收到返回数据应先进行解压gzdecode后,再进行正常的数据处理。
zhen Int 是否真太阳时 例:1:考虑真太阳时 2:不考虑真太阳时     
非必传,如果不传递这个参数,默认2
province String 省 例:北京市    
非必传,但是如果考虑真太阳时,省和市都必传,点击此处了解省市列表
city String 市 例:北京    
非必传,但是如果考虑真太阳时,省和市都必传,点击此处了解省市列表

请求参数示例

$request_data = [
'api_key' => 'FsF1CsVevk3N17w7oBkSydfSk',
'name' => '张三',
'sex' => '0',
'type' => '1',
'year' => '1994',
'month' => '4',
'day' => '30',
'hours' => '10',
'minute' => '0',
'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": "张三",
      "gongli": "1994-04-30 10:00:00",  //公历
      "nongli": "一九九四年三月二十日 巳时", //农历
      "qiyun": "1年10个月20天后起运",      //起运
      "jiaoyun": "1996-03-21后交运",      //交运
      "taiyuan": "己未",                  //胎元
      "taiyuan_nayin": "天上火",           //胎元纳音
      "taixi": "辛卯",                    //胎息
      "taixi_nayin": "松柏木",            //胎息纳音
      "minggong": "壬申",                 //命宫
      "minggong_nayin": "剑锋金",          //命宫纳音
      "shengong": "甲戌",                 //身宫
      "shengong_nayin": "山头火",          //身宫纳音
      "shengxiao": "狗",                 //生肖
      "xingzuo": "金牛"                  //星座
      "siling": "戊"                   //司令
      "jiaoyun_mang": "逢丙、庚年 清明前3天的午时 交大运"                  //盲派口诀交运
      "xingxiu": "胃宿西方白虎",      //星宿
      "minggua": {
        "minggua_name": "乾",         //命卦
        "minggua_fangwei": "西四命"    //命卦方位
      }
      "wuxing_wangdu": "水旺 木相 金休 土囚 火死",    //五行旺度
      "wuxing_xiji": "喜土 用火 闲金 仇水 忌木",    //五行喜忌
      "tiangan_liuyi": "戊癸合化火 戊壬相克 壬乙相生",   //天干留意
      "dizhi_liuyi": "辰辰自刑 巳亥相冲",    //地支留意
      "xiyongshen": { //喜用神   无敌律数八字五行量化法
      "qiangruo": "八字偏弱", //八字强弱
      "xiyongshen": "金", //以金为喜用神
      "jin_number": 0,   //五行统计 金有0个
      "mu_number": 1,    //五行统计 木有1个
      "shui_number": 2,  //五行统计 水有2个
      "huo_number": 3,   //五行统计 火有3个
      "tu_number": 2,    //五行统计 土有2个
      "tonglei": "金水", //同类为金水
      "yilei": "木火土",  //异类为木火土
      "rizhu_tiangan": "水" //命主五行属水
      "zidang": 0,      //自党分
      "yidang": 9,      //异党分
      "zidang_percent": "0%", //自党占百分比
      "yidang_percent": "100%",//异党占百分比
      "jin_score": 75,  //五行金能量分数
      "mu_score": 16,   //五行木能量分数
      "shui_score": 118,//五行水能量分数
      "huo_score": 36,//五行火能量分数
      "tu_score": 139,//五行土能量分数
      "jin_score_percent": "19.53%", //五行金能量占比
      "mu_score_percent": "4.17%",   //五行木能量占比
      "shui_score_percent": "30.73%", //五行水能量占比
      "huo_score_percent": "9.38%", //五行火能量占比
      "tu_score_percent": "36.2%", //五行土能量占比
      "yinyang": "阴阳平衡" //五行阴阳参考
    },
    "detail_info": {
      "dayun_info": [                   //排大运 农历
        {
          "dayun_index": 1,             //第1轮大运
          "dayun_start_year": 1996,     //大运起始年(包含)
          "dayun_start_age": 3,         //大运起始年龄(即岁数,包含)。
          "dayun_end_year": 2005,       //大运结束年(包含)。
          "dayun_end_age": 12,          //大运结束年龄(即岁数,包含)。
          "dayun_start_ganzhi": "己巳",  //大运起始年的干支。
          "dayun_xun": "甲子",           //该大运所在旬。
          "dayun_kongwang": "戌亥",      //空亡
          "dayun_shishen": "伤官",       //第1轮大运十神
          "dayun_changsheng": "临官",    //第1轮大运长生
          "dayun_year_tg": "甲",         //大运年天干
          "dayun_year_dz": "子",         //大运年地支
          "dayun_year_cg": [             //大运年地支藏干
            "癸"
          ],
          "dayun_year_tg_god": "食神",    //大运年天干十神
          "dayun_year_dz_god": [        //大运年地支十神
            "劫财"
          ],
          "dayun_dz_star_cs": "帝旺",     //大运年地支十二长生|星运
          "dayun_dz_self_cs": "沐浴",     //大运年地支十二长生|自坐
          "dayun_nayin": "海中金",         //纳音
          "dayun_wuxing": "木水",         //大运年天干地支五行
          "dayun_tg_liuyi": "癸甲相生 壬乙相生",    //大运天干留意
          "dayun_dz_liuyi": "子拱亥 子辰半合水局 辰辰自刑", //大运地支留意

          "liunian_info": [             //排流年 农历
            {
              "liunian_index": 0,       //流年位于当前大运中的序号(数字,0-9)。
              "liunian_year": 1996,
              "liunian_age": 3,
              "liunian_ganzhi": "丙子",
              "liunian_xun": "甲戌",
              "liunian_kongwang": "申酉",
              "liunian_shishen": "比肩",
              "liunian_changsheng": "胎",
              "liunian_jieqi": [{   //流年12节气
                    "jieqi_name": "立春", //流年节气名
                    "jieqi_solar_ymdhms": "1994-02-04 09:30:56", //流年节气阳历信息
                    "jieqi_lunar_ymdhms": "1993-12-24 09:30:56"  //流年节气阴历信息
                }, {
                    "jieqi_name": "惊蛰",
                    ......
                }, {
                    "jieqi_name": "清明",
                    ......
                }, {
                    "jieqi_name": "立夏",
                     ......
                }, {
                    "jieqi_name": "芒种",
                     ......
                }, {
                    "jieqi_name": "小暑",
                     ......
                }, {
                    "jieqi_name": "立秋",
                    ......
                },
                    ......
                 {
                    "jieqi_name": "小寒",
                    "jieqi_solar_ymdhms": "1995-01-06 03:34:05",
                    "jieqi_lunar_ymdhms": "1994-12-06 03:34:05"
                }],
              "liunian_year_tg": "丙",
              "liunian_year_dz": "子",
              "liunian_year_cg": [
                "癸"
              ],
              "liunian_tg_god": "比肩",
              "liunian_dz_god": [
                "正官"
              ],
              "liunian_dz_star_cs": "胎",
              "liunian_dz_self_cs": "胎",
              "liunian_nayin": "涧下水",
              "liunian_wuxing": "火水",
              "liunian_tg_liuyi": "庚癸相生 乙庚合化金 壬乙相生",
              "liunian_dz_liuyi": "午亥暗合 巳亥相冲",
              "liunian_shensha": "福星 天厨",
              "liuyue_info": [      //流月信息  农历
                {
                  "liuyue_index": 0,
                  "liuyue_month": "正",
                  "liuyue_ganzhi": "庚寅",
                  "liuyue_xun": "甲申",
                  "liuyue_kongwang": "午未",
                  "liuyue_shishen": "偏财",
                  "liuyue_changsheng": "长生",
                  "liuyue_month_tg": "庚",
                  "liuyue_month_dz": "寅",
                  "liuyue_month_cg": [
                    "甲",
                    "丙",
                    "戊"
                  ],
                  "liuyue_month_tg_god": "偏财",
                  "liuyue_month_dz_god": [
                    "偏印",
                    "比肩",
                    "食神"
                  ],
                  "liuyue_dz_star_cs": "长生",
                  "liuyue_dz_self_cs": "绝",
                  "liuyue_nayin": "松柏木",
                  "liuyue_wuxing": "金木"
                  "liuyue_tg_liuyi": "乙庚合化金 戊壬相克 壬乙相生",
                  "liuyue_dz_liuyi": "寅午半合火局 寅巳相害"
                  "liuyue_shensha": "福星 天厨", //流月神煞
                },
                 {...}, //第2个流月
                 {...}, //第3个流月
                 ......
                 {...}, //第10个流月
                 {...}, //第11个流月
                 {...}, //第12个流月
            },
            {...}, //第二个流年
            {...}, //第三个流年
            {...},
            {...},
            {...},
            {...},
            {...},
            {...},
            {...},//第十个流年
          ],
          "xiaoyun_info": [  //小运信息 农历
            {
              "xiaoyun_index": 0,   //小运位于当前大运中的序号(数字,0-9)。
              "xiaoyun_year": 1996,
              "xiaoyun_age": 3,
              "xiaoyun_ganzhi": "丙申",
              "xiaoyun_xun": "甲午",
              "xiaoyun_kongwang": "辰巳",
              "xiaoyun_shishen": "比肩",
              "xiaoyun_changsheng": "病"
              "xiaoyun_year_tg": "戊",
              "xiaoyun_year_dz": "申",
              "xiaoyun_year_cg": [
                "庚",
                "壬",
                "戊"
              ],
              "xiaoyun_tg_god": "七杀",
              "xiaoyun_dz_god": [
                "偏印",
                "比肩",
                "七杀"
              ],
              "xiaoyun_dz_star_cs": "长生",
              "xiaoyun_dz_self_cs": "病",
              "xiaoyun_nayin": "大驿土",
              "xiaoyun_wuxing": "土金",
              "xiaoyun_tg_liuyi": "戊癸合化火 戊壬相克 壬乙相生",
              "xiaoyun_dz_liuyi": "申亥相害 申辰半合水局 巳申合化水 巳亥相冲"
            },
            {...}, //第二个小运
            {...},
            {...},
            {...},
            {...},
            {...},
            {...},
            {...},
            {...},//第十个小运
          ],
          "dayun_shensha": "禄神 亡神 干禄" //第1轮大运神煞
        },
        {
          "dayun_index": 2,         //第2轮大运
          "dayun_start_year": 2006,
          "dayun_start_age": 13,
          "dayun_end_year": 2015,
          "dayun_end_age": 22,
          "dayun_start_ganzhi": "庚午",
          "dayun_xun": "甲子",
          "dayun_kongwang": "戌亥",
          "dayun_shishen": "偏财",
          "dayun_changsheng": "帝旺",
          "liunian_info": [
            {...},
            {...},
            {...},
            {...},
            {...},
            {...},
            {...},
            {...},
            {...},
            {...},
          ],
          "xiaoyun_info": [
             {...},
             {...},
             {...},
             {...},
             {...},
             {...},
             {...},
             {...},
             {...},
             {...},
          ],
          "dayun_shensha": "天乙 羊刃 福星 将星" //第2轮大运神煞
        },
        {
          ...
          "liunian_info": [
            {...},
            {...},
          ],
          "xiaoyun_info": [
            {...},
            {...},
          ],
          "dayun_shensha": "金舆 流霞" //第3轮大运神煞
        },
        {
          ...
          "liunian_info": [
            {...},
            {...},
          ],
          "xiaoyun_info": [
            {...},
            {...},
          ],
          "dayun_shensha": "天德 文昌 驿马" //第4轮大运神煞
        },
        {
          ......
        },
        {
          ...
          "liunian_info": [
             {...},
             {...},
          ],
          "xiaoyun_info": [
             {...},
             {...},
          ],
          "dayun_shensha": "月德 国印" //第9轮大运神煞
        }
      ],
      "dayun_born_info":{// 出生年到第一个大运年期间每一年的数据
            {...}, //字段跟大运dayun_info内容一致,区别在于dayun_info是排大运,dayun_born_info是从出生年到第一个大运年之间几年数据
      }

      "sizhu_info": { //四柱信息
        "year": {           //年柱信息
          "tg_god": "偏印",  //年天干十神|主星
          "tg": "甲",       //年天干
          "dz": "戌",       //年地支
          "cg": [           //年藏干(跟地支十神|副星一一对应)
            "戊",
            "辛",
            "丁"
          ],
          "dz_god": [      //年地支十神|副星(跟年藏干一一对应)
            "食神",
            "正财",
            "劫财"
          ],
          "dz_star_cs": "墓",//年地支十二长生|星运
          "dz_self_cs": "养",//年地支十二长生|自坐
          "kw": "申酉",       //空亡
          "ny": "山头火",      //纳音
          "wx": "木土",       //五行
          "xun": "甲戌",      //年柱所在旬
          "shensha": "空亡 国印 华盖" //年柱神煞
        },
        "month": {          //月柱信息
          "tg_god": "食神",  //参考上面
          "tg": "戊",
          "dz": "辰",
          "cg": [
            "戊",
            "乙",
            "癸"
          ],
          "dz_god": [
            "食神",
            "正印",
            "正官"
          ],
          "dz_star_cs": "冠带",
          "dz_self_cs": "冠带",
          "kw": "戌亥",
          "ny": "大林木",
          "wx": "土土",
          "xun": "甲子",
          "shensha": "空亡"  //月柱神煞
        },
        "day": {           //日柱信息
          "tg_god": "日主",
          "tg": "丙",
          "dz": "戌",
          "cg": [
            "戊",
            "辛",
            "丁"
          ],
          "dz_god": [
            "食神",
            "正财",
            "劫财"
          ],
          "dz_star_cs": "墓",
          "dz_self_cs": "墓",
          "kw": "午未",
          "ny": "屋上土",
          "wx": "火土",
          "xun": "甲申",
          "shensha": "空亡 天罗 国印 华盖" //日柱神煞
        },
        "hour": {       //时柱信息
          "tg_god": "正官",
          "tg": "癸",
          "dz": "巳",
          "cg": [
            "丙",
            "庚",
            "戊"
          ],
          "dz_god": [
            "比肩",
            "偏财",
            "食神"
          ],
          "dz_star_cs": "临官",
          "dz_self_cs": "胎",
          "kw": "午未",
          "ny": "长流水",
          "wx": "水火",
          "xun": "甲申",
          "shensha": "禄神 文昌 天厨 亡神 红鸾 干禄"  //时柱神煞
        }
      }
      "taishen_info": { //胎命身信息
        "taiyuan": {        //胎元信息
          "ganzhi": "癸巳",
          "xun": "甲申",
          "kongwang": "午未",
          "changsheng": "临官",
          "gan": "癸",
          "zhi": "巳",
          "dz_cg": [
            "丙",
            "庚",
            "戊"
          ],
          "tg_god": "正财",
          "dz_god": [
            "偏印",
            "食神",
            "比肩"
          ],
          "dz_star_cs": "临官",
          "dz_self_cs": "胎",
          "nayin": "长流水",
          "wuxing": "水火",
          "tg_liuyi": "丁癸相冲 丁壬合化木 壬乙相生",
          "dz_liuyi": "巳亥相冲",
          "shensha": "天乙 太极 禄神 流霞 劫煞 日贵"
        },
        "taixi": {          //胎息信息
          "ganzhi": "癸巳",
          "xun": "甲申",
          "kongwang": "午未",
          "changsheng": "临官",
          "gan": "癸",
          "zhi": "巳",
          "dz_cg": [
            "丙",
            "庚",
            "戊"
          ],
          "tg_god": "正财",
          "dz_god": [
            "偏印",
            "食神",
            "比肩"
          ],
          "dz_star_cs": "临官",
          "dz_self_cs": "胎",
          "nayin": "长流水",
          "wuxing": "水火",
          "tg_liuyi": "丁癸相冲 丁壬合化木 壬乙相生",
          "dz_liuyi": "巳亥相冲",
          "shensha": "天乙 太极 禄神 流霞 劫煞 日贵"
        },
        "minggong": {       //命宫信息
          "ganzhi": "癸卯",
          "xun": "甲午",
          "kongwang": "辰巳",
          "changsheng": "沐浴",
          "gan": "癸",
          "zhi": "卯",
          "dz_cg": [
            "乙"
          ],
          "tg_god": "正财",
          "dz_god": [
            "正官"
          ],
          "dz_star_cs": "沐浴",
          "dz_self_cs": "长生",
          "nayin": "金箔金",
          "wuxing": "水木",
          "tg_liuyi": "丁癸相冲 丁壬合化木 壬乙相生",
          "dz_liuyi": "巳亥相冲",
          "shensha": "天乙 福星 日贵"
        },
        "shengong": {       //身宫信息
          "ganzhi": "癸卯",
          "xun": "甲午",
          "kongwang": "辰巳",
          "changsheng": "沐浴",
          "gan": "癸",
          "zhi": "卯",
          "dz_cg": [
            "乙"
          ],
          "tg_god": "正财",
          "dz_god": [
            "正官"
          ],
          "dz_star_cs": "沐浴",
          "dz_self_cs": "长生",
          "nayin": "金箔金",
          "wuxing": "水木",
          "tg_liuyi": "丁癸相冲 丁壬合化木 壬乙相生",
          "dz_liuyi": "巳亥相冲",
          "shensha": "天乙 福星 日贵"
        }
      }
    }
  }
}
                

失败返回示例

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