How to retrive Yahoo Backlinks count with PHP

Here's a simple script to retrieve the approximate number of backlinks Yahoo has for a site. The function and how to call it follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function get_yahoo_backlinks_count($url) {
	$appid = ''; // get this from https://developer.apps.yahoo.com/wsregapp/
	$url = "http://search.yahooapis.com/WebSearchService/V1/webSearch?appid=$appid&query=site:$url&results=1";
 
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_REFERER, 'http://www.yoursite.com/');
	$response = curl_exec($ch);
	curl_close($ch);
 
	$xml = simplexml_load_string($response);
	return $xml -> attributes() -> totalResultsAvailable;
}
 
echo get_yahoo_backlinks_count('google.com');
[ad]

One thought on “How to retrive Yahoo Backlinks count with PHP”

Leave a Reply

Your email address will not be published. Required fields are marked *