How to calculate google trackbacks using Google APIs in PHP

I am trying to figure out how to pull backlinks for a specific domain. I understand that you are just looking for link:domain.com .

I understand that there are several messages, very similar to this, but every post using their old API, which has been discontinued. Google Search API API API has been replaced by Google Custom Search, and will not return anywhere near the same results as a search on Google.

Is there any other API than Custom Search that will allow me to get results. I have heard that they have some paid services that I would be happy to use, if I can find the links or documents.

Any help is greatly appreciated.

+7
php google-api
source share
2 answers

I don’t know if there is a way to do what you want easily with Google. Using the search links ( link:yourdomain.com ) will only lead to the return of a small subset of links to your site. This can be seen in practice if you are looking for links directly using Google. The best example is site:yourdomain.com . Only this search will not show you all the pages of your site. Google loves to keep curtains for the entire dataset.

What you really need is someone who indexes the data for you and allows you to pull it back (presumably for SEO purposes). The best place I know of would be the Mozyscape API . They make their own crawls and build their own index. They have a free tier, and Open Site Explorer installs the same dataset. Ahrefs will be another potential resource, but you must be a subscriber to use their system.

+4
source share

A Google API search is still processing such a search.

Use the following function, then use the provided example.

 <?php function load_content ($url, $auth = true,$auth_param) { $curl = curl_init(); if ($auth){ curl_setopt($curl, CURLOPT_USERPWD,$auth_param); } curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_TIMEOUT, 3); $content = curl_exec($curl); //$header = curl_getinfo($curl); curl_close($curl); $res['msg'] = "";//$header; $res['content'] = $content; return $res; } function google_indexed($url){ $html = load_content ($url,false,""); return $html; } ?> auth_param); <?php function load_content ($url, $auth = true,$auth_param) { $curl = curl_init(); if ($auth){ curl_setopt($curl, CURLOPT_USERPWD,$auth_param); } curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_TIMEOUT, 3); $content = curl_exec($curl); //$header = curl_getinfo($curl); curl_close($curl); $res['msg'] = "";//$header; $res['content'] = $content; return $res; } function google_indexed($url){ $html = load_content ($url,false,""); return $html; } ?> ); <?php function load_content ($url, $auth = true,$auth_param) { $curl = curl_init(); if ($auth){ curl_setopt($curl, CURLOPT_USERPWD,$auth_param); } curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_TIMEOUT, 3); $content = curl_exec($curl); //$header = curl_getinfo($curl); curl_close($curl); $res['msg'] = "";//$header; $res['content'] = $content; return $res; } function google_indexed($url){ $html = load_content ($url,false,""); return $html; } ?> 

Example:

 <?php $domain = "google.com"; $indexed["google"] = google_indexed("http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=site:$domain"); print_r( $indexed["google"] ); ?> 
0
source share

All Articles