How To Get Google To Index Your Website Instantly Using the Indexing API


How To Get Google To Index Your Website Instantly Using the Indexing API

In this article, I am going to show you how you can use Google's new indexing API & get your website's pages and content crawled instantly instead of waiting for Google to index you using Nodejs

The reasons to use the Indexing API are the following:

  1. Index multiple pages at once (saves time)
  2. Rank faster

Now you can make sure your website pages are crawled and that you can rank faster than your competition which is very important when it comes to time-sensitive and competing content. 

If you follow this step-by-step guide, you’ll be able to achieve this in no time!

Create a new project in Google Console

First, we need to create a project, to do that click here. Set a project name and click continue

Then follow the link which will create enable the Indexing API for your project by clicking here, make sure you have selected the project you created

Now, click "Next" and then "Enable" to successfully enable the API for your project

Then you will be redirected to the "Create Credentials" page where you need to select "Indexing API" then "Application Data" and finally "No, I'm not using them". Then click "Next

Create a Service Account

Once you’ve created your project, create a service account by opening the service accounts page. You will first be prompted to select the API project you wish to create this service account in (select the one created in the previous step).

After selecting the project you want to create a service account for, you’ll be taken to the following page, where you simply need to click the "Create Service Account" button

Then enter a name and description for the created service account. 

Make sure you copy the "Service Account ID"  (as we going to use it later). Then, click on the "Create" button

Then you will be able to download the JSON file which holds the credentials.  To do so, simply click the three vertical dots in the Actions column, and then select Manage keys.

You will then be taken to the following page when you can click Add Key and then select the Create new key option

Then choose the default JSON format when prompted in the overlay, and click Create

Add the Service Account as an owner of your Google Search Console Property

To do this, you’ll need to register and verify your website with the Google Search Console (if you haven’t done so already) which is super easy: just follow the recommended steps to verify ownership of your property.

After verifying your property, open the Google Search Console, select your property on the left (if prompted), and then click on Settings near the bottom

Then click on Users and Permissions

Click on the three dots next to your account, and then click on Manage property owners

Then from the page, you are redirected to scroll to the bottom and click on the Add an owner button in the Verified owners section

Enter the Service account ID (the one you copied out earlier) in the new owner’s email address field and click Continue

Setup the Nodejs script 

First clone my GitHub repo which you can visit here:

Make sure you have already installed Nodejs otherwise you can do that by clicking here

Open cmd in the cloned project and type npm i to install the required packages

Then replace service_account.json with the one you installed earlier but make sure you rename it to service_account.json

Then add the URLs you want to index on the urls.txt file (formatted line by line)

And finally, run on the cmd node index.js

You should get as an output a JSON response containing "URL_UPDATED"

Have in mind there is a limit of 250 URLs per day that you can index automatically

I hope this article was helpful, have a great day! 😀

Share this article:


    Leave a Reply

    Your email address will not be published. Required fields are marked*

      Recent Posts