January 10, 2010

Python - Lookup Google PageRank Score

Here is a Python module for getting the PageRank of a site from Google. It uses the Google Toolbar 3.0.x/4.0.x Pagerank Checksum Algorithm.

The code is here:

pagerank.py

You can import it as a module and use its get_pagerank(url) method to lookup the PageRank of a URL from your Python code.

For example:

#!/usr/bin/env python

import pagerank

rank = pagerank.get_pagerank('http://www.google.com')
print rank

* note: only use this within Google's terms of service

Post a Comment