Web Ninja Google PageRank API

I am no longer offering this API. It has been disabled here and rebranded on a new site. Please visit http://honorcoders.com/hc-google-pagerank-api/ for continued use.

Web Ninja PageRank API is the answer that most people are looking for when they need find out a website’s Google Pagerank. If you look on the internet, you will find code snippets or classes that say they can check Google’s Pagerank but they either use Google’s old API or no longer work for whatever reason. This is the reason I wrote this API. I tried to make the API as simple as possible to use and it has a built in caching system for quicker results.

When a page is queried it will cache the result in a database for up to one day so the next time the same website’ pagerank is checked it will not have to query google again. This will help with faster results for the application you use for this API.

Also, so this system does not get abused (one of the reasons Google removed their API), you may only do 50 queries to Google’s pagerank system an hour per IP and your IPs query count will get reset every hour on the hour. This does not include caches results. Let’s say you call the api for the site example.com, that will use 1 query to google. Within the same day, every time you make a call to the api for example.com again it will be a cached result and will not count toward your 50 queries an hour. This will be enough for 99.99% of you out there. If you need more then that you can contact me with a request for an api key that will allow you to do more.

Since there is a caching system and there is a limit per IP there are 2 types of calls through the API. A basic one and a detailed one. The basic API call will just return the Google Pagerank of a url. The detailed one will return the Google Pagerank, if it was a cached result, and what your query count is for this hour. Please look in the Usage section for more information on this.

Usage

Basic API Call

For a basic api call it is as simple as using this url:

http://josh-fowler.com/prapi/?url=<URL>

Replace the <URL> with the url you would like to check and it will return that site’s pagerank.

Examples:

Basic API call:

http://josh-fowler.com/prapi/?url=http://google.com

Returns:

 10 

Basic API call with php file_get_contents function:

<?php
	$googlepr =  file_get_contents('http://josh-fowler.com/prapi/?url=http://google.com');
	echo "Google Pagerank: ".$googlepr;
?>

Returns:

 Google Pagerank: 10 

*Most hosting companies will have the file_get_contents fucntion on. If not, you can use cURL or really anything else you like.

Detailed API Call

For a detailed api call it is as simple as using this url:

http://josh-fowler.com/prapi/?d=1&url=<URL>

Replace the <URL> with the url you would like to check and it will return that site’s pagerank, if it were cached or not, and how many query calls you have done this hour.

Examples:

Detailed API call:

http://josh-fowler.com/prapi/?d=1&url=http://google.com

Returns:

 10:1:2 

*The 10 is the Google PageRank, the next number will either be 0 or 1 for if it were a cached result (0 if it queried Google or 1 if it were a cached result), and the last number is your current query count.

Basic API call with php file_get_contents function:

<?php
    $googlepr =  file_get_contents('http://josh-fowler.com/prapi/?d=1&url=http://google.com');
    $expandedpr = explode(':',$googlepr);
    echo "Google Pagerank: ".$expandedpr[0]."<br>";
    echo "Cached Result: ".$expandedpr[1]."<br>";
    echo "Query Count: ".$expandedpr[2]."<br>";
?>

Returns:

 Google Pagerank: 10
 Cached Result: 1
 Query Count: 2 

*Again most hosting companies will have the file_get_contents fucntion on. If not, you can use cURL or really anything else you like.

Responses

Most of the time you will get a result of 0 through 10 based on the site’s Google Pagerank. We have added in a couple other numbered responses as error codes:

Code Response
-1 This is a Google response code that means either the site is not listed in their PageRank system yet or it has been blacklisted by Google. *You will get this with new sites.
-2 The site is not cached and Google’s server could not be reached. Please try again later.
-3 Please check your url.
-4 The site is not cached and you have exceeded your query count. Please try again in an hour.
-5 API no longer in service. Please visit http://honorcoders.com/hc-google-pagerank-api/