本文主要是介绍八字合婚 api接口,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
八字合婚可以双方的生辰八字来以本命卦,年支同气,月令合,日干合,天干五合,合婚论吉凶,并给出相应分数,测算结果仅供参考。
接口名称:八字-八字合婚
接口平台:缘份居国学研究(缘份居国学研究开发者API)
接口地址:https://api.yuanfenju.com/index.php/v1/Bazi/hehun
支持格式:application/x-www-form-urlencoded
请求方式:HTTP GET/POST
请求示例:
$api_secret = "wD******XhOUW******pvr";
$gateway_host_url = "https://api.yuanfenju.com/index.php/v1/Bazi/hehun";//请求参数
$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": "30", //合婚命宫打分"male_minggong": "震","female_minggong": "震","description": "此项为30分。说明:以东四命与西四命之说来合,如果相合,那么在购房时,应买与自己命宫相合的房子。""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": "此项为5分。说明:男女生月相同者互相间也是很有缘份的。""detail_description": "男方月支为辰,女方月支为辰。此局为亥亥自刑。月支代表兄弟...."//月令合详细批示},"rigan": { //日干相合"score": "25",//日干相合打分"male_yue_zhi": "丁","female_yue_zhi": "丁","description": "此项为25分。说明:何谓日干阴阳舒配得所?日干五行相同,一阴一阳的组合男女结合的机缘最大,如甲日干逢乙日干,庚日干逢辛日干之类。""detail_description": "男方日干为丁。五行信息:五行属火,谓之纯阴之火;女...."//日干相合详细批示},"tiangan": { //天干五合"score": "5", //天干五合打分"male_yue_zhi": "丁","female_yue_zhi": "丁","description": "此项为5分。说明:其次是天干五合,如甲日干逢己日干,庚日干逢乙日干之类。再次则是比和或相生。""detail_description": "男方日天干为丁,女方日天干为丁。此局为。日干代表夫妻宫,此......"//天干五合详细批示},"zinv": { //子女同步"nannv": "男", //生男生女"score": "15", //子女同步打分"description": "此项为15分。说明:何谓子女同步?西方的科学家在探索男女结合的奥秘时提出了【性染色体论】,我们东方人在四柱预测中看头胎子女的性别,男女双方的八字中头胎子女的性别必须一致。""detail_description": "头胎可能生男,此为报恩男,他将继承家族血脉......"//子女同步详细批示},"all_score": 100, //合婚总分"male_sx": "龙", //男方生肖"female_sx": "龙", //女方生肖"male_xz": "天蝎座", //男方星座"female_xz": "天蝎座"//女方星座}}}
这篇关于八字合婚 api接口的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!