How to Create a System for Bulk URL Submission to Google Index and Checking Site Indexing
In this article, we’ll explain in detail how we created the system, the steps we followed, and provide working code examples.
Introduction
Every website owner faces the need to monitor page indexing and accelerate the addition of new URLs to Google. In a highly competitive environment, it’s crucial for new content or product pages to appear in search results as quickly as possible, rather than waiting weeks for a search bot to discover them.
Manually checking indexing and submitting links through Google Search Console quickly becomes a tedious and time-consuming task, especially if you run an online store with hundreds of products or a blog with regular posts.
We decided to automate this process using Google’s tools. For bulk URL submission to the index, we used the Google Indexing API, and for subsequent checks of page presence in search results — the Google Custom Search API. This approach allows:
-
simplifying bulk indexing of new pages;
-
instantly checking which pages are already in search and which are not;
-
monitoring the effectiveness of SEO efforts.
1. Creating a Google Project and Service Account
The first step — preparing an account for API usage:
-
Create a project in Google Cloud Console
-
Go to console.cloud.google.com and create a new project (e.g.,
example-index
). - link .
-
2. Create a Service Account
In the IAM & Admin → Service Accounts section, create a new service account.
-
Assign a name (e.g.,
vitaminator-com
), -
Select the role
Owner
The next window will appear, where you don’t need to specify anything; just click the Done button.
Create and Download JSON Key
After creating the service account, generate a key in JSON format. It contains:
-
client_email
— service account email, -
private_key
— private key, -
other authentication data.
Example key:
{
"type": "service_account",
"project_id": "example-index",
"private_key_id": "abc123",
"private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
"client_email": "example@example-index.iam.gserviceaccount.com",
...
}
2. Enable Google Indexing API
In the APIs & Services → Library section, find Indexing API
and enable it for the project. here
Node.js Script for Sending URLs to Google Index
We used Node.js and the googleapis
library for authentication via JWT.
const fs = require('fs');
const { google } = require('googleapis');
const request = require('request');
const key = require('./service_account.json');
const jwtClient = new google.auth.JWT(
key.client_email,
null,
key.private_key,
['https://www.googleapis.com/auth/indexing']
);
const batch = fs.readFileSync('urls.txt').toString().split('\n');
jwtClient.authorize((err, tokens) => {
if (err) return console.error('Auth error:', err);
const items = batch.map(url => ({
'Content-Type': 'application/http',
'Content-ID': '',
body: 'POST /v3/urlNotifications:publish HTTP/1.1\n' +
'Content-Type: application/json\n\n' +
JSON.stringify({ url, type: 'URL_UPDATED' })
}));
const options = {
url: 'https://indexing.googleapis.com/batch',
method: 'POST',
headers: { 'Content-Type': 'multipart/mixed' },
auth: { bearer: tokens.access_token },
multipart: items
};
request(options, (err, resp, body) => {
if (err) return console.error('Error sending batch:', err);
console.log('✅ Google Index API Response:\n', body);
});
});
After running the script, each link is sent to Google Index. Example response:
{
"urlNotificationMetadata": {
"url": "https://vitaminator.com.ua/product/bluebonnet-nutrition-120"
}
}
Checking Indexing with Custom Search API
To check if a URL is in the index:
Create a Custom Search Engine (CSE):
Create it here - here
-
Enter the site
example.com
, -
Restrict the search to this domain only.
Obtain API Key (search engine identifier).
https://console.cloud.google.com/apis/credentials
-
Follow the link from the error:
https://console.cloud.google.com/projectselector2/apis/api/customsearch.googleapis.com/overview?pli=1&inv=1&invt=Ab5_kg&supportedpurview=project -
Click Enable API for this project.
You should end up with:
Api key = AIzaSyAk3234234234d-gZAk8wmJE4IGFo_w8
CX = e35e2de1234566c5
Script for checking indexing in Google:
const fs = require('fs');
const axios = require('axios');
const urls = fs.readFileSync('urls.txt').toString().split('\n');
const apiKey = 'YOUR_API_KEY';
const cx = 'YOUR_CX';
(async () => {
for (const url of urls) {
try {
const resp = await axios.get('https://www.googleapis.com/customsearch/v1', {
params: { key: apiKey, cx, q: `site:${url}` }
});
const status = resp.data.items && resp.data.items.length > 0 ? '✅ Indexed' : '❌ Not indexed';
console.log(`${url} — ${status}`);
fs.appendFileSync('index-check-results.txt', `${url} — ${status}\n');
// Pause for 1 second to avoid exceeding limits
await new Promise(r => setTimeout(r, 1000));
} catch (e) {
console.error('Error checking:', e.response?.data || e.message);
}
}
})();
Limits and Quotas
-
Google Indexing API — 200 requests per day by default.
-
Custom Search API — free quota of 100 requests per day.
-
To avoid exceeding limits:
-
Use pauses between requests,
-
Split URLs into batches,
-
Request a quota increase through Google Cloud Console.
-
We created a fully automated process:
-
Sending URLs to Google Index,
-
Checking indexing for each page,
-
Saving results to a file,
-
Option to integrate with other systems (CMS, Telegram bot, Google Sheets).
This speeds up SEO processes, saves time, and makes indexing monitoring transparent.
After obtaining all APIs and Keys
We prepared a ready-to-use archive where you only need to insert the obtained keys.
Download link - here
Instructions for Installing and Using the Indexing Check and URL Submission Script
Requirements
-
Installed Node.js (version 18+).
Download here: https://nodejs.org/.
After installation, verify: -
An account in Google Cloud Console.
-
Enabled Indexing API.
-
Created Service Account and downloaded JSON key.
-
Enabled Custom Search API and created a search engine (CSE) for your site.
-
Installation
-
Unpack the archive to a convenient folder.
For example: