website

How to Quickly Index Your Website on Google Using Google Indexing API

byHendra Wijaya

How to Quickly Index Your Website on Google Using Google Indexing API For website or blog owners, the time Google takes to index new articles can be very long — sometimes it takes days. Fortunately, there’s a way to get your articles to appear in search results in just minutes, using Google Indexing API. What […]

  1. How to Quickly Index Your Website on Google Using Google Indexing API

For website or blog owners, the time Google takes to index new articles can be very long — sometimes it takes days. Fortunately, there’s a way to get your articles to appear in search results in just minutes, using Google Indexing API.

What is Google Indexing API?

Google Indexing API is an official service from Google to notify the search engine that there are:

  • New pages that need to be indexed, or
  • Old pages that have been updated or deleted.

Officially, this API is intended for JobPosting and BroadcastEvent, but many developers and SEO experts use it for regular blog articles, and the results are still effective in speeding up indexing.

Steps to Use Google Indexing API

1. Create a Project in Google Cloud

  • Go to Google Cloud Console
  • Click New Project, give it a name (e.g., IndexingAPI)
  • Open the API & Services → Library menu, then enable Indexing API

2. Create a Service Account and Download JSON File

  • Go to API & Services → Credentials
  • Click Create Credentials → Service Account
  • After completion, open the Keys tab → Add Key → JSON
  • Save the .json file, for example: indexing-api.json

3. Add Service Account Email to Search Console

  • Open Google Search Console
  • Select your domain, for example https://earnwise.uk/
  • Add the email from the JSON file (indexingapi@project-id.iam.gserviceaccount.com)
  • Grant Full permission

4. Send URL to Indexing API

Can be done with a simple Node.js script:

import { google } from "googleapis";
import fs from "fs";

const key = JSON.parse(fs.readFileSync("indexing-api.json", "utf8"));

const jwt = new google.auth.JWT(key.client_email, null, key.private_key, [
  "https://www.googleapis.com/auth/indexing",
]);

const index = google.indexing({ version: "v3", auth: jwt });

async function publishUrl(url) {
  const res = await index.urlNotifications.publish({
    requestBody: { url, type: "URL_UPDATED" },
  });
  console.log("✓ Indexed:", url, res.data);
}

publishUrl("https://earnwise.uk/new-article");

Run:

npm install googleapis
node index.js

5. (Optional) Integrate with WordPress

If you’re using WordPress, you can use plugins:

  • Instant Indexing for Google
  • or create a custom script in functions.php to automatically send URLs whenever a post is published.

If You’ve Previously Set Up Indexing API

  • If you’re still using the same domain, you don’t need to create a new project.
  • If you’re switching to a new domain (e.g., from domain.com to earnwise.uk), you just need to add the new domain in Search Console and add the old service account to that new domain.

You only need one Google Cloud project — no need to recreate everything.

Additional Tips

  • Use a maximum of 200 URLs per day per domain
  • Ensure your page is publicly accessible (HTTP 200)
  • Also include sitemap.xml so Google can still perform natural crawling
  • Use a combination of API + sitemap for best results

Conclusion

Google Indexing API is the fastest way to ensure your content quickly appears in Google search results. With a one-time setup, you can:

  • Speed up indexing of new articles
  • Control which URLs are removed or updated
  • Increase the chances of organic traffic faster

If you’ve previously set up Indexing API for another domain, simply add the new domain to Search Console — without having to recreate the project.

Share this article