八字合盘可以双方的生辰八字来以本命卦,年支同气,月令合,日干合,天干五合,合盘论吉凶,并给出相应分数,测算结果仅供参考。
接口名称:八字-八字合盘
接口平台:缘份居国学研究(缘份居国学研究开发者API)
接口地址:https://api.yuanfenju.com/index.php/v1/Bazi/hepan
支持格式:application/x-www-form-urlencoded
请求方式:HTTP GET/POST
请求示例:
$api_secret = "******";
$gateway_host_url = "https://api.yuanfenju.com/index.php/v1/Bazi/hepan";
//请求参数
$request_data = ['api_key' => $api_secret,'male_name' => '张三','male_type' => '1','male_year' => '1988','male_month' => '11','male_day' => '8','male_hours' => '12','male_minute' => '20','female_name' => '李四','female_type' => '1','female_year' => '1988','female_month' => '11','female_day' => '8','female_hours' => '12','female_minute' => '20',
];//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);$response = curl_exec($ch);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返回示例:
{"errcode": 0,"errmsg": "请求成功","notice":"本次测算结果仅供娱乐使用,请勿用于封建迷信和违法用途。","data": {"male": {"bazi": [ //甲方八字"戊辰", //甲方八字【年】"癸亥", //甲方八字【月】"丁卯", //甲方八字【日】"丙午" //甲方八字【时】],"gl_year": "1988", //甲方公历年"gl_month": "11", //甲方公历月"gl_day": "8", //甲方公历日"gl_hours": "12", //甲方公历时"sex": "乾造", //性别"name": "张三", //甲方姓名"gongli": "1988年11月8日12时20分", //甲方公历年月日时分"kw": "戌亥", //甲方空亡"tg_cg_god": [ //甲方天干十神"伤", //甲方天干十神【年】"杀", //甲方天干十神【月】"日元", //甲方天干十神【日】"劫" //甲方天干十神【时】],"dz_cg": [ //甲方地支藏干"戊|乙|癸", //甲方地支藏干【年】"壬|甲", //甲方地支藏干【月】"乙", //甲方地支藏干【月】"丁|己" //甲方地支藏干【时】],"dz_cg_god": [ //甲方地支藏干十神"伤|枭|杀", //甲方地支藏干十神【年】"官|印", //甲方地支藏干十神【月】"枭", //甲方地支藏干十神【月】"比|食" //甲方地支藏干十神【时】],"day_cs": [ //甲方八字长生衰旺"衰", //甲方八字长生衰旺【年】"胎", //甲方八字长生衰旺【月】"病", //甲方八字长生衰旺【日】"临官" //甲方八字长生衰旺【时】],"na_yin": [ //甲方八字纳音"大林木", //甲方八字纳音【年】"大海水", //甲方八字纳音【月】"炉中火", //甲方八字纳音【日】"天河水" //甲方八字纳音【时】]},"female": {"bazi": [ //乙方八字"戊辰", //乙方八字【年】"癸亥", //乙方八字【月】"丁卯", //乙方八字【日】"丙午" //乙方八字【时】],"gl_year": "1988", //乙方公历年"gl_month": "11", //乙方公历月"gl_day": "8", //乙方公历日"gl_hours": "12", //乙方公历时"sex": "坤造", //性别"name": "李四", //乙方姓名"gongli": "1988年11月8日12时20分", //乙方公历年月日时分"kw": "戌亥", //乙方空亡"tg_cg_god": [ //乙方天干十神"伤", //乙方天干十神【年】"杀", //乙方天干十神【月】"日元", //乙方天干十神【日】"劫" //乙方天干十神【时】],"dz_cg": [ //乙方地支藏干"戊|乙|癸", //乙方地支藏干【年】"壬|甲", //乙方地支藏干【月】"乙", //乙方地支藏干【日】"丁|己" //乙方地支藏干【时】],"dz_cg_god": [ //乙方地支藏干十神"伤|枭|杀", //乙方地支藏干十神【年】"官|印", //乙方地支藏干十神【月】"枭", //乙方地支藏干十神【日】"比|食" //乙方地支藏干十神【时】],"day_cs": [ //乙方八字长生衰旺"衰", //乙方八字长生衰旺【年】"胎", //乙方八字长生衰旺【月】"病", //乙方八字长生衰旺【日】"临官" //乙方八字长生衰旺【时】],"na_yin": [ //乙方八字纳音"大林木", //乙方八字纳音【年】"大海水", //乙方八字纳音【月】"炉中火", //乙方八字纳音【日】"天河水" //乙方八字纳音【时】]},"minggong": { //合作合盘"male_fengshui": "东四命","female_fengshui": "东四命","score": "10", //合作合盘打分"male_minggong": "震","female_minggong": "震","description": "此项满分为10分。以东四命与西四命之说来合,如果相合,那么在选择合作场地时,应选与自己命宫相合的方位。",//合作合盘简批"detail_description": "甲方命卦为巽,适宜合作场地方位为东南方。乙方命卦为巽...."//合作合盘详批},"nianqitongzhi": { //生意合盘"score": "20", //生意合盘打分"male_nian_zhi": "辰","male_nian_zhi_desc": "木","female_nian_zhi": "辰","female_nian_zhi_desc": "木","description": "此项满分为20分。如寅卯辰会东方木气,虎兔龙合作生意成功的机缘就大于其它属相;巳午未会南方火气......", //生意合盘简批"detail_description": "甲方年支为卯,乙方年支为巳。此局为平。年支代表生意宫,此局平......", //生意合盘详批},"yueling": { //财运合盘"score": "5", //财运合盘打分"male_yue_zhi": "亥","female_yue_zhi": "亥","description": "此项满分为20分,如果此项分数越高,说明双方合作的财运运势越好。",//财运合盘简批"detail_description": "甲方月支为寅,乙方月支为子。此局为平。月支代表财帛宫......", //财运合盘详批},"rigan": { //恋爱合盘"score": "25",//恋爱合盘打分"male_yue_zhi": "丁","female_yue_zhi": "丁","description": "此项满分为20分。如果日干五行相同,一阴一阳的组合的双方恋爱的机缘......"//恋爱合盘简批"detail_description": "甲方日干为癸。五行信息:五行属水,谓之纯阴之水;乙方日干为丙。五行信息:五行属火,...."//恋爱合盘详批},"tiangan": { //运势合盘"score": "5", //运势合盘打分"male_yue_zhi": "丁","female_yue_zhi": "丁","description": "此项满分为20分,如果此项分数越高,说明双方合作的总体运势越好。",//运势合盘简批"detail_description": "甲方日天干为癸,乙方日天干为丙。此局为平。日干代表命宫,主运势,此局平,甲方与乙方的合作运势呈现出安稳与和谐的状态...."//运势合盘详批},"jiankang": { //健康合盘"score": "10", //健康合盘打分"description": "此项满分为10分,如果此项分数越高,说明双方的健康运势越好。"//健康合盘简批"detail_description": "甲方与乙方都注重身体健康,他们相互支持,共同促进彼......",//健康合盘详批},"all_score": 100, //合盘总分"male_sx": "龙", //甲方生肖"female_sx": "龙", //乙方生肖"male_xz": "天蝎座", //甲方星座"female_xz": "天蝎座"//乙方星座}}}