六爻排盘 api数据接口

六爻排盘是一种古老的易学命理系统,‌起源于易经,‌是中国古代命理学的重要组成部分。‌它通过将六个爻位按照顺序排列,‌形成六爻,‌每个爻有阳爻和阴爻两种状态,‌共有64种不同的排列组合,‌每一种排列组合都称为一卦。‌

接口名称:流盘-六爻排盘

接口平台:缘份居国学研究(缘份居国学研究开发者API)

接口地址:https://api.yuanfenju.com/index.php/v1/Liupan/liuyao

支持格式:application/x-www-form-urlencoded

请求方式:HTTP GET/POST请求示例:

php 复制代码
<?php

//您的密钥
$api_secret = "wD******XhOUW******pvr";
//请求择日择时接口
$gateway_host_url = "https://api.yuanfenju.com/index.php/v1/Liupan/liuyao";


//请求参数
$request_data = [
    'api_key' => $api_secret,
    'born_year' => '1999', //公历出生年
    'pan_model' => '3',    //起卦方式 例:1:自动起卦 2:自选时间 3:终身卦 4:手工指定 5:数字起卦
    'year' => '1990',
    'month' => '5',
    'day' => '23',
    'hours' => '8',
    'minute' => '52',
    'sex' => '1',

];

//curl
function curlSend($process_gateway, $data_arr, $type = 1) {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $process_gateway);
    curl_setopt($ch, CURLOPT_POST, $type);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data_arr));
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_FAILONERROR, true); // Set this option to handle errors

    $response = curl_exec($ch);

    if ($response === false) {
        $error_message = curl_error($ch);
        // Handle or output the error message as needed
        echo "cURL error: " . $error_message;
    }

    curl_close($ch);
    return $response;
}

function process_host($curlPost,$gateway_url) {
    $response = curlSend($gateway_url,$curlPost,1);
    print_r($response);

}

process_host($request_data,$gateway_host_url);

六爻排盘接口JSON返回示例:

php 复制代码
{
  "errcode": 0,
  "errmsg": "请求成功",
  "notice": "本次测算结果仅供娱乐使用,请勿用于封建迷信和违法用途。",
  "data": {
    "sex": "女",
    "model": "终身卦",
    "gongli": "1990-05-23 08:52:00",
    "nongli": "一九九〇年四月廿九日 辰时",
    "nianming": "己卯",
    "sizhu_info": {
      "year_gan": "庚",
      "year_zhi": "午",
      "month_gan": "辛",
      "month_zhi": "巳",
      "day_gan": "戊",
      "day_zhi": "子",
      "hour_gan": "丙",
      "hour_zhi": "辰"
    },
    "gua_info": {
      "bengua": { //本卦
        "gua_mark": "011000", //卦图
        "gua_yao_info": { 
          "liuqin": {  //六亲
            "gua_yao6": "官鬼癸酉金",
            "gua_yao5": "父母癸亥水",
            "gua_yao4": "妻财癸丑土",
            "gua_yao3": "官鬼辛酉金",
            "gua_yao2": "父母辛亥水",
            "gua_yao1": "妻财辛丑土"
          },
          "shiying": { //世应
            "shi_yao_position": "4",
            "ying_yao_position": "1"
          },
          "liushen": { //六神
            "gua_yao6": "朱雀",
            "gua_yao5": "青龙",
            "gua_yao4": "玄武",
            "gua_yao3": "白虎",
            "gua_yao2": "螣蛇",
            "gua_yao1": "勾陈"
          },
          "fushen": { //伏神
            "has_fushen": "1",
            "fushen_arr": [
              {
                "fushen": "兄弟庚寅木",
                "fushen_yao_position": "2"
              },
              {
                "fushen": "子孙庚午火",
                "fushen_yao_position": "4"
              }
            ]
          }
        },
        "gua_name": "地风升", //卦名
        "gua_gong": "震宫",   //卦宫
        "gua_qian": "士人来占必得名,生意买卖也兴隆,......",
        "gua_yaoci": "升:元亨,用见大人,勿恤,南征吉。彖曰:柔以时升,巽而顺,刚中而应,是以大亨。用见大人,勿恤;有庆也。南征吉,志行也。象曰:地中生木,升;君......",
        "gua_description": {
          "gua_shiye": "十分顺利,不断发展,依时而进,逐步上升,前程远大,但应逐步发展,切莫因顺利而冒进。谨慎小心,修养德行,追随有德行的前辈,真诚对待事业。",
          "gua_jingshang": "遵守商业道德,从小处着手,逐渐开拓,通过自己的勤劳,真诚竞争,稳重为好,切莫冒失而成大错。",
          "gua_qiuming": "努力学习,加强修养,以自己的聪明才智,必能得志,若有人引荐,前途更为广阔。但应注意节制。",
          "gua_waichu": "十分顺利,尤其是南行,不会有灾祸。",
          "gua_hunlian": "双方以诚相待,逐步培养情感,一定可以成功。",
          "gua_juece": "如意随愿。聪明、灵活、具有良好的成功基础,严格要求自己,谦虚和顺,虚心向长辈求教,逐步、稳健地发展自己的事业,将犹如树木的成长,终于会成栋梁之才。但在成长过程中,务必处处谨慎,坚持真诚和正直,大胆前进。"
        },
        "gua_xiongji": "上上卦"
      },
      "biangua": { //变卦
        "gua_mark": "010000",
        "gua_yao_info": {
          "liuqin": {
            "gua_yao6": "官鬼癸酉金",
            "gua_yao5": "父母癸亥水",
            "gua_yao4": "妻财癸丑土",
            "gua_yao3": "子孙戊午火",
            "gua_yao2": "妻财戊辰土",
            "gua_yao1": "兄弟戊寅木"
          },
          "shiying": {
            "shi_yao_position": "3",
            "ying_yao_position": "6"
          },
          "liushen": [],
          "fushen": []
        },
        "gua_name": "地水师",
        "gua_gong": "坎宫",
        "gua_qian": "将帅领旨去出征,骑着烈马拉硬弓,百步穿杨去得准,箭中金钱喜气生。",
        "gua_qian_desc": "异卦(下坎上坤)相叠。"师"指军队。坎为水、为险;坤为地、为顺,喻寓兵于农。兵凶战危,用兵乃圣人不得已而为之,但它可以顺利无阻碍地解决矛盾,因为顺乎形势,师出有名,故能化凶为吉。",
        "gua_yaoci": "师:贞,丈人,吉无咎。彖曰:师,众也,贞正也,......",
        "gua_description": {
          "gua_shiye": "阻力很大,困难很多,处于激烈的竞争状态,必与他人密切合作,谨小慎微,行为果断,切忌盲目妄动,适度即可,注意保全自己。机动灵活,严于律已。从容沉着对付一切,必能成功。",
          "gua_jingshang": "已有一定的积蓄,可以从事大的营销活动,但必卷入激烈商战,以刚毅顽强的精神和高尚的商业道德,辅以灵活的方法,勿贪图小利,勿掉以轻心,加强与他人的沟通,必可摆脱困境,化险为夷。",
          "gua_qiuming": "具备很好的条件,但须有正确的引导,务必严格要求自己,克服不利因素的干扰,经过扎实努力,必可名利双全。",
          "gua_waichu": ""行险而顺。"虽有可能遇到麻烦,但结果一定十分顺利,可放心出行。",
          "gua_hunlian": "慎重、专注,否则会陷入"三角"纠纷。痴情追求可以达到目的。",
          "gua_juece": "天资聪颖,性格灵活,具有坚强的意志,对事业执着追求,迎难而进。可成就大事业。喜竞争,善争辩,富有冒险精神,不免带来麻烦,务老成持重,不贪功,以中正为要。"
        },
        "gua_xiongji": "中上卦"
      }
    },
    "guashen": "酉",
    "kongwang": "午未",
    "shensha_info": {
      "yima": "寅",
      "taohua": "寅",
      "guiren": "丑、未",
      "rilu": "巳"
    },
    "dongyao": "3",
    "has_biangua": "1"
  }
}