How to Automate Google PageRank Tracking for your keywords in a Google Spreadsheet [Process Automation]

How to Automate Google PageRank Tracking for your keywords in a Google Spreadsheet [Process Automation]

Google PageRank is an essential factor that Google considers while deciding whether or not your website will show on the top Search Engine Result Pages, also known as SERPs. Appearing on top of search engine listings means that your content is easily seen by the users. While there are other search engines, Google PageRank is a gold standard for your content, and other search engines also follow similar techniques for listings. It not only becomes a significant factor to the popularity of your content but also reaps direct benefit for your product or service. Hence, tracking Google PageRank for keywords is critical analysis that must be done at the organizational level.

Google PageRank

PageRank(PR) is a Google Search algorithm that ranks websites based on how important they are. It was named after the term "web page" and co-founder Larry Page.The more important a website is, the more likely it is that it will get links from other websites.

Monitoring the progress of keywords you want to rank

It becomes a tedious task to repeatedly search for the keywords you want to rank and monitor the progress. There are quite a number of expensive tools to monitor keyword rankings. This can be accomplished by using scraping libraries provided. One such tool is googlesearch, which is a Python library for searching Google, easily. googlesearch uses requests and BeautifulSoup4 to scrape Google.

In this blog, we aim to provide a tutorial on how to get Google pagerank in Google spreadsheet. The arrangement of this kind makes it easier for an organization to track and monitor the progress of their keywords. So let’s begin.

Step 1: Install googlesearch Python Library

To install googlesearch Python Library, run the following command:

python3 -m pip install googlesearch-python

Required Params of the googlesearch: Your basic requirements for googlesearch include-

  • query: query string that we want to search for
  • lang: Language
  • TLD: TLD stands for the top-level domain which means we want to search our results on or or some other domain
  • num: Number of result we want
  • start: The first result to retrieve
  • stop: The last result to retrieve. Use None to keep searching forever
  • pause: Lapse to wait between HTTP requests
  • Return: Generator (iterator) that yields found URLs

Python code

Follow the code below to move ahead on the process.

Step 2: Google Spreadsheet Settings

Make sure you are following along, you'll need a spreadsheet. Head over to Google Sheets and create one.

Step 3: Create a service account and OAuth2 credentials

Now, you'll need to create a service account and OAuth2 credentials from the Google API Console. Follow the simple steps below to enable the API and grab your credentials.

  • Head over to the Google API Console.
  • Create a new project by selecting My Project -> + button
  • Search for 'Google Drive API', ‘Google Sheets API’ and enable them.
  • Head over to 'Credentials' (sidebar), click 'Create Credentials' -> 'Service Account Key'
  • Select Compute Engine service default, JSON, hit create.
  • Save the JSON file in your system.
  • Share your spreadsheet with the "" email listed in the JSON file.

Step 4: Operations in Spreadsheet

To access spreadsheets via Google Sheets API you need to authenticate and authorize your application. Follow these steps for the same-

  • oauth2client - to authorize with Google Drive API
  • gspread - to interact with Google Spreadsheets

Step 5: Install Required Package

After completing the aforementioned steps, now Install required package. You will have to install gspread, oauth2client using the following code-

pip install gspread oauth2client

You can perform insert, fetch, update and delete in the spreadsheet. Let’s say you want to fetch keywords from a spreadsheet and have to update the search ranks corresponding to the keywords (Fig.1)-


Keywords representation in Spreadsheet

You have every column name as a keyword in the sheet. You will fetch the keywords and update the corresponding rank to that keyword in below row.
Finally, import all required packages as discussed above.


To Conclude

Tracking Google PageRank is an essential factor in the process of search engine optimization since it measures the importance of a web page. Relevance of any web page is a critical factor that determines it’s PageRank. But tracking the progress is what matters the most to any organization's SEO efforts. Whether you’re an SEO consultant or an organization tracking the progress of your top rated keywords, a good SEO strategy with right measuring tools can go a long way.

Reach out to us if you have further questions on this tutorial on how to automate Google PageRank for your keywords in a Google spreadsheet.