缘份居在线起名,姓名打分API接口

接口数据api

接口平台:https://api.yuanfenju.com/

开发文档:https://doc.yuanfenju.com/

支持格式:JSON

请求方式:HTTP POST

 
//密钥
$api_secret = "wD******XhOUW******pvr";
//请求网关
$gateway_host_url = "https://api.yuanfenju.com/index.php/v1/Dafen/xingming";
 
//请求参数
$curlPost['name'] = "张三";
$curlPost['api_key'] = $api_secret;
 
//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($curlPost,$gateway_host_url);
 

返回数据

{
  "errcode": 0,
  "errmsg": "请求成功",
  "data": {
    "name": "张三",
    "count": 10,
    "description": {
      "score": "70", //姓名评分
      "title": "辛酸失意 徒劳心力", //姓名简批
      "description": "不喜欢过平静的生活,生活漫无目标,好像身陷茫然中,以致会惹上莫明病痛,且易犯官司等不幸之状况。如常说好话,常做善事,就能由绝处而转变大成功。创业过程比较容易投机取巧,起伏多变,不喜欢循规蹈矩平实的过日。易生意外,为人好面子,有点外华内虚。" //批注详解
    },
    "jixiong": "一般般",                            //姓名总批
    "天格": 8,                                      //天格打分
    "天格描述": {
      "desc": "努力发达,贯彻意愿,不望进退,可期成功。",  //天格数理
      "xiongji": "吉",                              //天格吉凶
      "desc1": "",
      "score": ""
    },
    "地格": 4,                                      //地格打分
    "地格描述": {
      "desc": "日被云遮,苦难折磨,非有毅力,难望成功。",  //地格数理
      "xiongji": "凶",                              //地格吉凶
      "desc1": "",
      "score": ""
    },
    "人格": 10,                                     //人格打分
    "人格描述": {
      "desc": "乌云遮月,黯淡无光,空费心力,徒劳无功。",  //人格数理
      "xiongji": "凶",                              //人格吉凶
      "desc1": "",
      "score": ""
    },
    "总格": 10,                                    //总格打分
    "总格描述": {
      "desc": "乌云遮月,黯淡无光,空费心力,徒劳无功。", //总格数理
      "xiongji": "凶",                             //总格吉凶
      "desc1": "",
      "score": ""
    },
    "外格": 2,                                      //外格打分
    "外格描述": {
      "desc": "动摇不安,一荣一枯,一盛一衰,劳而无功。",  //外格数理
      "xiongji": "凶",                             //外格吉凶
      "desc1": "",
      "score": ""
    },
    "三才": "金火水"                                //三才配置
  }
}

你可能感兴趣的:(php,开发语言)