seo优化 > 新闻资讯 > phh获取爱站百度权重api查询接口

phh获取爱站百度权重api查询接口

互联网
<?php
error_reporting(0);
$domain = isset($_GET['q']) ? addslashes(trim($_GET['q'])) : '127.0.0.1';
$url = 'https://baidurank.aizhan.com/baidu/'.$domain.'/';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($curl, CURLOPT_REFERER, $url);
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30');
$curldata = curl_exec($curl);
curl_close($curl);
preg_match('|<img src="//statics.aizhan.com/mobile/images/br/(.*?).png"|i', $curldata, $matchs);
$br = $matchs[1];
header("Content-type: image/png");
readfile($br.'.png');
?>

示例:https://5t5g.com/api/baidu/?q=5t5g.com