Отправьте GET-запрос без параметров на адрес ресурса пользователя
$token='токен';
function get_stat($url,$headers) {
$handle=curl_init();
curl_setopt($handle, CURLOPT_URL, $url);
curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
$response=curl_exec($handle);
$code=curl_getinfo($handle, CURLINFO_HTTP_CODE);
return array("code"=>$code,"response"=>$response);
}
$result=get_stat('https://api.webmaster.yandex.net/',array('Authorization: OAuth '.$token));
$user_id=str_replace('https://api.webmaster.yandex.net/v3/user/','',$result["response"]);
$result=get_stat('https://api.webmaster.yandex.net/v3/user/'.$user_id.'/hosts',array('Authorization: OAuth '.$token));
$xml=new SimpleXMLElement($result["response"]);
$hosts_xml=$xml->xpath("host");
$hosts=array();
foreach($hosts_xml as $host) {
$hosts[(string)$host->name]=
array(
"name"=>(string)$host->name,
"verification_state"=>(string)$host->verification->attributes()->state,
"crawling_state"=>(string)$host->crawling->attributes()->state,
"virused"=>(string)$host->virused,
"last-access"=>(string)$host->{'last-access'},
"tcy"=>(string)$host->tcy,
"url-count"=>(string)$host->{'url-count'},
"index-count"=>(string)$host->{'index-count'},
"href"=>(string)$host->attributes()->href
);
}
unset($hosts_xml);
unset($xml);