Google APIs are a collection of application programming interfaces (APIs) created by Google that allows users to communicate with Google Services.
APIs follow particular rules and processes to achieve that requests and responses are clearly communicated.
In this tutorial, we will try to teach how to index your web pages with the help of Google Indexing API with Python on Windows 10.
Here come the steps
Step 1: How to explore and install Google Indexing API.
Step 2: How to connect Google Indexing API to Google Search Console.
Step 3: How to use Google Indexing API with python.
Step 1: How to explore Google Indexing API.
Visit and signup google developers console.
Then you got such a screen
Then create a new project for installing a Google Indexing API.
After the creation of the project, you got some notifications to "select project" and you can do this as per instruction.
After completing these steps you got a google developers console dashboard screen. Then select the hamburger menu on the left side of the screen and hit the click on Apis and services option > library
After this, you got this screen
Then search "google indexing API" and visit indexing API.
Then click the enable button to install this API to google developers console.
Step 2: How to associate Google Indexing API to Google Search Console.
After installation of API to google cloud console. Then again click the hamburger menu to get IAM and admin option> Service account
Create the service account by following this:
1. Fill up Service account details like a service account name.
Insert account name and username as per your choice. Then hit create and continue button.
*This service account name will be auto-filled to the service account id.
2. Give permission to this service account
Please always select the role of owner.
Then after clicking the done button and finalising these steps.
Now you can operate the Service accounts for project "XYZ" with email id like
Now you got an email id that makes the association between google cloud console, Google Indexing API, and Google search console.
Then manage a new key for the permanent association. So click the right side 3 dot option and go to manage keys.
Then we reached to keys section
then hit to add key and then click to create button and you got two key type option 1. JSON and 2. P12
Now we go with JSON option to create the key.
When you hit the create button you got a file of the private key to your computer.
The red mark box shows the downloaded file of the private key of JSON.
You got this file on the download folder of your computer. (In case of default settings)
Now you can ignore the tab of google developers console and time to make an association with Google Search Console and Google Indexing API.
So open the Google Search Console in a new tab and come to the dashboard.
Then go to the Users and permissions sections for the google service account associations.
Click on Add user and you got screen like this
Now you can enter the service account email id that's have been created during "Fill up Service account details like a service account name."
Now your Google Developers Console accounts, Google Indexing API, and Google Search Console are linked with each other.
Step 3: How to use Google Indexing API with python.
This will be a major step to use Google Indexing API for indexing web pages.
So first step will be a download and install python on your computer device.
Visit directly and download python from here: https://www.python.org/downloads/
After downloading the python, you should start installing python on your computer like this
When you get this popup screen of python, you must go to customize the installation like
and check all boxes before clicking the install button.
After installation Search python on your computer search bar like this
and you got a console like this
After python installation now creates a folder for Google Indexing API like this with the content of 3 files but first rename the download private account key to apidetails.json
- apidetails.json
- data.csv
- indexing.py
Now enter the Window + R button and cmd
Now enter the command of "pip install oauth2client httplib2" in CMD
After this install the Pandas file in the CMD
The command is "pip install pandas"
Now move to indexing step, So open again CMD
and call the folder by giving a command. eg: our Indexing folder is on E drive. So give the command like this "drive name:"
Now go to the Folder like this, eg: "cd drivename:\indexing" then enter this
Now enter the final command for the indexing process: python indexing.py
Here you send the bulk indexing request to google webmaster.