How to calculate google backlinks using google API in PHP

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.

Tags:

Php

Google Api