How to Send Bulk Indexing Request to Google? + Free Tool
Send upto 200 Indexing Requests to Google at once
One of my clients approached me with the issue that - there pages are discovered but none of them are indexed. And it’s been more than a week they have submitted the sitemaps.
Few reasons for slow indexing rate are -
New website
Content is not very unique
Google already have a lot of URLs indexed in that category
First 2 reasons matched with my clients website.
They are new, with not so unique content. But they have very less competitors.
Bigger Problem - They have thousands of pages published.
So I decided to do two things -
Improve the internal linking
Use Google Indexing API
Since we were on low engineering bandwidth, first was not possible at the time.
I went ahead and started sending Bulk Indexing Request to Google.
Here are the results -
We went from 0 to 33K in 7 Days!
Following are the steps on how to do it -
Enable Indexing API in Google Cloud Console
Creating Service Account
Creating Credentials
Adding service account email to Search Console
Before these steps, you will have to make sure that you have permission to send Indexing requests using API.
Click here to visit the Indexing API tester
You should land on this page -
If the above screen did not appear, follow the below steps -
Search for “Indexing API” in the search bar, and click on “Indexing API” under “Products”. Here is direct URL.
Click on “Reference” tab
Click on “publish” under “urlNotifications”
Then add the following details in the Request body -
Scroll below and click on “Execute” button.
If it responds with “200” status, then you have the permission else it will respond with Error 403 - Permission denied.
In that case, make sure you have Owner-level access in Search console.
Now that you have verified it, let’s start with the steps.
Here is the loom video on how to do it.
Enabling Indexing API
Visit Google Cloud Console
Create a project if you haven’t
Search for Indexing API
Click on “Enable”
Creating a Service Account Email
After Enable Indexing API, you will land on its Dashboard.
Click on “Credentials” on the left menu bar.
Click on “Manage Service Accounts”
Click on “Create Service Account” at the top
Add any service account name you want to and click “Create and Continue”
Under select, a role, search for “Owner” and click on “Continue”
Click “Done” and then copy the Email into some notepad shown on the display
Make sure to add the e-mail as “Owner” in your Google search console property.
Creating and Download Credentials File
Click on the 3 dots of this Service Account Email and then select “Manage Keys”
Click on “Add Key” > “Create”
This will download the Credentials JSON file. Make sure to save it in some important folder.
Adding service account email to Search Console
Now add the email you copied in the second step to your Search console and give it owner-level access.
The next step is to prepare a CSV file with maximum of 200 URLs in it. Make sure to name the column name “url”. Download the sample CSV file here.
Visit this tool.
Upload the CSV file in the first option.
Upload the credentials file in the second option. (It will be temporarily stored and deleted later).Click on Request Indexing.
Done!
It will return with the response received from the Google Indexing API.
Following is the complete Python script if you want to do it yourself locally -
from oauth2client.service_account import ServiceAccountCredentials
from googleapiclient.discovery import build
from googleapiclient.http import BatchHttpRequest
import httplib2
import json
import pandas as pd
#creating url list
all_urls_df = pd.read_csv('PATH TO CSV FILE')
top_200_urls = all_urls_df['url'].values.tolist()
#creating request body
values_list = []
for i in range(0,200):
values_list.append("URL_UPDATED")
zip_iterator = zip(top_200_urls, values_list)
a_dict = dict(zip_iterator)
requests = a_dict
# print(requests)
JSON_KEY_FILE = ('PATH TO JSON KEY FILE')
SCOPES = [ "https://www.googleapis.com/auth/indexing" ]
ENDPOINT = 'https://indexing.googleapis.com/batch'
#Credentials
credentials = ServiceAccountCredentials.from_json_keyfile_name(JSON_KEY_FILE, scopes = SCOPES)
http = credentials.authorize(httplib2.Http())
#building the service
service = build('indexing', 'v3', credentials=credentials)
#creating function to display the response by api
def insert_event(request_id, response, exception):
if exception is not None:
print(exception)
else:
print(response)
batch = service.new_batch_http_request(callback=insert_event)
# creating for loop to add urls and api type in batch function
for url, api_type in requests.items():
batch.add(service.urlNotifications().publish(body={"url": url, "type": api_type}))
#running batch function
batch.execute()
Thanks for reading!
Sharing is caring!
Facing issue? Tweet @stanabk
Hi dude, could you check the tools of https://bulk-indexing-request.herokuapp.com. it didn't work for me. Thanks in advance
Hi dude, could you check the tools of https://bulk-indexing-request.herokuapp.com. it didn't work for me. Thanks in advance