DEV Community

Cover image for Keyword Rank Checker PHP Script

Posted on • Originally published at

Keyword Rank Checker PHP Script

What Does SERP Mean?

SERP or Search Engine Result Page refers to the way the search engine displays search results. Among SEO professionals SERP most often refers to how will a page show up in the results and the page ranking in the search results. This post will be about Google SERPs.

Google Webmaster Tools has Search Analytics that show you your keyword rank for certain pages. But, there’s a delay of about 4 days in the data collection. Also, you can only do that for your own site, and not for the competition.

How to Create Your Own Keyword Rank Checker Using PHP

Using the Google Custom Search API, let’s see how we can create our own search engine keyword position checker PHP script.

You can take this even further. You could use the same code and store the position for each keyword and link. This way you can create your own free SERP rank tracker. This could potentially be a very powerful SEO tool similar to what you get for high paying SEO tools like Ahrefs or Semrush.

Before Using The Google SERP Checking PHP Script

The SERP Checking PHP script below works with the Google Custom Search API. In order to use the script with the API you will need follow these steps:

Activate Google Custom Search API and create credentials by going here:
Create a Google Custom Search Engine here:
You can test that your credentials and the custom search engine is working here:

Where to Get the Keyword Rank Checker PHP Script?

After you setup the Google Custom Search API, simply go here and download the PHP script:

php keyword rank checker

Alternatively, you can check out this Github repo:

Top comments (2)

feministclickback profile image

This is cool. Can anyone access the Custom search API?

codingdudecom profile image

Yes, anyone with a free Google account