工具-干支工具

文档说明

        通过指定的年月日时干支,计算出十神,藏干,纳音,自坐,星运,空亡,神煞,干支留意等详细信息。

请求方式

POST GET

https://api.yuanfenju.com/index.php/v1/Gongju/ganzhi

请求头

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

请求参数

字段 类型 描述
api_key String 密钥
year_gan Int 年干下标 例:0
注意:十天干下标数字分别为:甲:0,乙:1,丙:2,丁:3
戊:4,己:5,庚:6,辛:7,壬:8,癸:9
year_zhi Int 年支下标 例:10
注意:十二地支下标数字分别为:子:0,丑:1,寅:2,卯:3,
辰:4,巳:5,午:6,未:7,申:8,酉:9,戌:10,亥:11
month_gan Int 月干下标 例:4
month_zhi Int 月支下标 例:4
day_gan Int 日干下标 例:2
day_zhi Int 日支下标 例:10
hour_gan Int 时干下标 例:9
hour_zhi Int 时支下标 例:5
sex Int 性别 例:0男 1女

请求参数示例

$request_data = [
'api_key' => 'FsF1CsVevk3N17w7oBkSydfSk',
'year_gan' => '0',
'year_zhi' => '10',
'month_gan' => '4',
'month_zhi' => '4',
'day_gan' => '2',
'day_zhi' => '10',
'hour_gan' => '9',
'hour_zhi' => '5',
'tyoe' => '0',
];          

返回参数

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

成功返回示例

{
  "errcode": 0,
  "errmsg": "请求成功",
  "notice":"本次测算结果仅供娱乐使用,请勿用于封建迷信和违法用途。",
  "data": {
    "ganzhi_info": {
      "year": {
        "ganzhi": "甲戌", //年干支
        "xun": "甲戌",    //年所在询
        "kongwang": "申酉", //年空亡
        "changsheng": "墓", //年长生
        "gan": "甲",     //年天干
        "zhi": "戌",     //年地支
        "dz_cg": [         //年地支藏干
          "戊",
          "辛",
          "丁"
        ],
        "tg_god": "偏印",//年天干十神
        "dz_god": [     //年地支藏干十神
          "比肩",
          "伤官",
          "正印"
        ],
        "dz_star_cs": "墓",  //年地支十二长生|星运
        "dz_self_cs": "养",  //年地支十二长生|自坐
        "nayin": "山头火",   //年纳音
        "wuxing": "木土",    //年五行
        "shensha": "空亡 国印 华盖" //年神煞
      },
      "month": {        //月信息
        "ganzhi": "戊辰",
        "xun": "甲子",
        "kongwang": "戌亥",
        "shishen": "食神",
        "changsheng": "冠带",
        "gan": "戊",
        "zhi": "辰",
        "dz_cg": [
          "戊",
          "乙",
          "癸"
        ],
        "tg_god": "食神",
        "dz_god": [
          "比肩",
          "正官",
          "正财"
        ],
        "dz_star_cs": "冠带",
        "dz_self_cs": "冠带",
        "nayin": "大林木",
        "wuxing": "土土",
        "shensha": "空亡"
      },
      "day": {          //日信息
        "ganzhi": "丙戌",
        "xun": "甲申",
        "kongwang": "午未",
        "shishen": "比肩",
        "changsheng": "墓",
        "gan": "丙",
        "zhi": "戌",
        "dz_cg": [
          "戊",
          "辛",
          "丁"
        ],
        "tg_god": "比肩",
        "dz_god": [
          "比肩",
          "伤官",
          "正印"
        ],
        "dz_star_cs": "墓",
        "dz_self_cs": "墓",
        "nayin": "屋上土",
        "wuxing": "火土",
        "shensha": "空亡 天罗 国印 华盖"
      },
      "hour": {         //时信息
        "ganzhi": "癸巳",
        "xun": "甲申",
        "kongwang": "午未",
        "shishen": "正官",
        "changsheng": "临官",
        "gan": "癸",
        "zhi": "巳",
        "dz_cg": [
          "丙",
          "庚",
          "戊"
        ],
        "tg_god": "正官",
        "dz_god": [
          "偏印",
          "食神",
          "比肩"
        ],
        "dz_star_cs": "临官",
        "dz_self_cs": "胎",
        "nayin": "长流水",
        "wuxing": "水火",
        "shensha": "禄神 文昌 天厨 亡神 词馆 红鸾 干禄"
      },
       "attention": {   //留意
        "gan": "无",     //天干留意
        "zhi": "子午相冲 寅午半合火局 午午自刑" //地支留意
      }
    }
  }
}
                

失败返回示例

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