php code to get Google pagerank

While reading about SEO ( Search engine optimization ) on various blogs and forums. I found people willing to know the procedure of getting their website’s  Google Pagerank through php. Searching more about it and then following the Google toolbar which give’s the google pagerank, I got the way of getting google page rank of any website through php.

You can download the script here. To use the script type:
http://scriptLocation/scriptName.ext?url=domainName.ext

Note:

A: pagerank is given on a scale of 10.
B: If you get no output then your page is not ranked by Google yet.
C: Zero (0), can be your pagerank.
D: I have no idea, if this is legal to extract this data through automated scripts. Please do not blame me if in case you face a problem.

16 Responses to “php code to get Google pagerank”

php code to get Google pagerank | PHP-Blog.com (December 26th, 2008 at 3:39 pm)

[...] more here: php code to get Google pagerank Related ArticlesBookmarksTags PHP PHP is a computer scripting language. Originally [...]

viralpatel (December 30th, 2008 at 3:49 am)

Nice article..
really helpful.. I am trying to re-write this in JSP/Java to port it in my J2EE application.

Aman (December 30th, 2008 at 3:52 am)

Welcome!
Well, pls forward the JSP/Java code to me, so that I can put it up on my blog…

[...]  php code to get Google pagerank () [...]

Alek (December 31st, 2008 at 10:29 pm)

Hi. Good site.

Pagerank PHP Google | Tellaw.org (January 2nd, 2009 at 1:28 pm)

[...]  php code to get Google pagerank (0 visite) [...]

Mat (January 4th, 2009 at 5:29 am)

Thanks! I tried porting this over to Java, but with my limited knowledge of PHP I had a hard time wrapping my head around the variable types. I’d love it if someone would do all the hard work for me and send a copy my way! :)

Aman (January 4th, 2009 at 5:33 am)

Would have surely helped u! But, I have no idea of JAVA. I would surely try to get it done for you by someone.

Divyaprakash (January 6th, 2009 at 6:48 am)

Thanks for your information.

SEOsean (January 8th, 2009 at 1:00 pm)

Thanks for the post. Doing that in PHP has been around for some time now I’ve seen other example code elsewhere but I just posted a question on Google’s Webmaster Help to find out what is allowed and what is not. Although I have not got a definitive answer to that, just that its “probably” not something they want you to do. Here is the thread so you can read it http://www.google.com/support/forum/p/Webmasters/thread?tid=3f19044158a7a3ce&hl=en&fid=3f19044158a7a3ce00045fe9a51225ce

Also I just finished creating an SEO tool on my site that calculates the amount of PageRank from links it will take to get your website up to a specific PageRank. It’s not totally 100% accurate but it’s neat play around with. You can check it out here http://www.seosean.com/seo-tools/pagerank-calculator/

vic (January 24th, 2009 at 4:33 am)

Hi,

I just ported the code to Java, it’s just a matter of using the right types. Worked flawlessly right away :) I did it quickly you probably should do a little renaming here and there ;P

Here it is : http://paste-it.net/public/bd0454f/

Aman (January 24th, 2009 at 4:49 am)

Hey! thanks for that…
Hope other people like and find it usefull

Chris Maddern (July 11th, 2009 at 12:50 am)

Hi Aman, Very useful article – quick and easy way of returning PR.

Thanks a lot!

Chris

Ariel@Web Backlinks (August 12th, 2009 at 10:40 pm)

Hey Thanks for the post. I had a working PHP module before but it suddenly stopped working. I’ve modified my script to use yours and it’s now working again.

Thanks again!

Ryan Adami (October 17th, 2009 at 4:36 pm)

Thanks for posting this script. I have three others that I use, but Google is getting good at blocking them. Does anyone know how to spoof the toolbar request with a Firefox plug-in?

Ryan Adami (October 17th, 2009 at 4:39 pm)

Just tested the code, still working a year later!

Leave your response!

Be nice. Keep it clean. Stay on topic. No spam.