You are on page 1of 10

Ex.

No: 3
Date: 25.08.2023
01.09.2023
Demonstrate how to use the Google WebMasters Indexing API
Aim:
To demonstrate the Usage of the Google Webmasters Indexing API.
Procedure
In this exercise, we will demonstrate how to utilize the Google Webmasters Indexing API to
request indexing for a specific URL. The Google Webmasters Indexing API allows web
developers and site owners to notify Google about new or updated content on their website,
prompting Google's search engine to crawl and index the specified URLs more efficiently.
By following the steps outlined in this exercise, you will learn how to:
 Authenticate and obtain necessary credentials for API access.
 Construct a valid API request to notify Google about a URL that requires indexing.
 Send the API request using appropriate HTTP methods.
 Handle API responses and interpret the results.

Steps:

1. Create API Credentials:


 Go to the Google Cloud Console (https://console.cloud.google.com/).
 Create a new project or select an existing one.
 Enable the "Indexing API" for your project.
 Create API credentials (OAuth 2.0 Client ID) and obtain the Client ID and Client
Secret.
2. Authorization Flow:
 Use the Client ID and Client Secret to authenticate your API requests using OAuth 2.0
authorization flow.
3. Construct the API Request:
 Use the constructed URL and payload to request indexing for a specific URL using the
Indexing API.
4. Send the API Request:
 Use appropriate HTTP methods (POST or PUT) to send the API request to the specified
endpoint.
5. Handle API Responses:
 Handle the API response, which will include information about the success or failure
of the indexing request.
Create a Project Select a New Project

Give Project name and then click Create Button

Go to APIs & Services and then Select Enabled APIs & services
Select Enable APIs and Services Button

Select your project and Search Indexing API in the API library and then click enable
Goto dashboard and then Select IAM & Admin Menu

In this menu select Service accounts

Then Click on Create service account


Enter Service Account Name and then Click on Create and Continue button
Then Select a Role as Owner and Click Continue button and Done

Successfully created the Service accounts for project

And then goto the Search Console and Select the URL Prefix and then paste the Word
Press Link
Select the Property

Goto Settings and then Select User and Permissions

And then Select Add User


Copy the contents from Service accounts for project property from
console.cloud.google.com and Click on ADD

Then Goto console.cloud.google.com and generate the key for the service account
property, Select AddKey -> Create a New Key
Select JSON and the click create and then Download & store the JSON file

Goto Website or Word Press Dashboard and Select the Plugins from left side Menu

Search instant indexing for google plugin and then select install Now and then it shows
Active
Then Goto Rank Math in WordPress Menu and select Instant Indexing

Copy the Content from JSON file and the Click Save Changes

Then Click Console Menu and add the URL in Instant Indexing
Your website will be indexed in Google
Copy your URL and check the same in your browsers

Result:
Thus The usage of the Google Webmasters Indexing API has been successfully
demonstrated using Google Search Console, Console.Cloud.Google.com and WordPress
Website.

You might also like