Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to calculate google backlinks using google API in PHP

Tags:

php

google-api

I have been trying to figure out how to pull the backlinks for a specific domain. I understand you simply search link:domain.com.

I do realize there are multiple posts very similar to this one however every post uses their old API which has been discontinued. The Google Search API has been replaced with Google Custom Search API and does not return anywhere near the same results as a google search.

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

Any help is greatly appreciated.

like image 234
James Avatar asked Jul 31 '13 19:07

James


1 Answers

I don't know that there's a way to do what you want easily with Google. Using the link search (link:yourdomain.com) will only return a small subset of the links to your site. You can see this in practice if you search for links directly using Google. A better example comes from searching site:yourdomain.com. That search alone won't show you all the pages on your site. Google likes to keep the curtain pulled for the entire data set.

What you really need is someone who indexes the data for you and lets you pull it back out (presumably for SEO purposes). The best place I know of would be the Mozscape API. They do their own crawls and build their own index. They have a free tier and that same data set powers Open Site Explorer. Another potential resource would be Ahrefs, but you have to be a subscriber to use their system.

like image 91
Machavity Avatar answered Oct 11 '22 22:10

Machavity