Indexing Checker for Google Search Console – Neuro-SEO

Antonio Blago
Antonio Blago

Indexing Checker for Google Search Console   Minutes of reading time remaining By Antonio Blago April 18, 2025

Google Search Console, Tutorial

Save more than 2 hours per week

Instructions

Google Apps Script for Indexing & Performance Check of URLs in Google Sheets (GSC + Indexing API)

📖 Part of the Google Search Console & Google Tools series:

Google Search Console Login

Set up a Google account – Guide

Google Search Console – An Overview

Add users to Google Search Console – Step-by-step

Google Search Console Indexing Performance Checker (Script)

Connect Google Search Console & BigQuery – Guide

Technical SEO: Find 404 errors with Google functions

Page with redirect in Google Search Console

This guide shows you step by step how to use Google Apps Script to query the indexing status and performance data (clicks, impressions, CTR, position) of multiple URLs from Google Search Console. All of this happens directly via a Google Sheet, e.g., named "URLs".

Requirements

All details are in the YouTube video.

Google Search Console access to your domain (e.g., sc-domain:your-domain.tld)

Google Cloud project with enabled Indexing API and Search Console API

Service Account with JSON key (private_key & client_email):

Go to: https://console.cloud.google.com/iam-admin/serviceaccounts

Select your project (at the top in the blue bar)

Click on the Service Account you created (e.g., gsc-index-bot@... )

Go to the "Keys" tab

Click on "Add Key > Create new key"

Select "JSON" as the format

Click on "Create" 🔽 The file will now be downloaded automatically (*.json)

The client_email value must be entered as a user with access in the GSC property

Instructions

Step 1: Create Google Sheet

Copy the template here: https://docs.google.com/spreadsheets/d/1_J9mHgJCW6pgdStwllSk8eYa-dDglsMwCOecu05vS5Q/edit?gid=497916964#gid=497916964

or create one yourself:

Open Google Drive

Create a new Google Sheet named "Indexing Checker" (or any name you like)

Enter the URLs to be checked in column A (starting from A2)

Columns B to J will be filled automatically by the script

Step 2: Create Apps Script Project

Go to Extensions in the sheet.

Click on "New Project"

Give the project a name (e.g., "GSC Sheet Check")

Step 3: Define Script Properties

Go to File > Project Properties > Script Properties

Enter two entries:

PRIVATE_KEY : the content of your private_key from the JSON file (with \n instead of real line breaks)

CLIENT_EMAIL : the client_email from your JSON file

Step 4: Prepare Google Sheet

Create a Google Sheet (e.g., named "URLs")

Enter the URLs to be checked in column A (starting from A2)

The results will automatically appear in columns B to J

Step 5: Insert Code

Copy the following code into the Apps Script Editor.

If necessary, replace sheet names and domain property:

const PRIVATE_KEY = PropertiesService.getScriptProperties().getProperty("PRIVATE_KEY");
const CLIENT_EMAIL = PropertiesService.getScriptProperties().getProperty("CLIENT_EMAIL");
const sheet_name = "URLs"

function checkIndexStatusWithAPI() {
const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheet_name); // ggf. Sheet-Name anpassen
const urls = sheet.getRange("A2:A" + sheet.getLastRow()).getValues();

const jwt = createJWT_(CLIENT_EMAIL, PRIVATE_KEY);
const token = getAccessToken_(jwt);

for (let i = 0; i < urls.length; i++) {
const row = i + 2;
const url = urls[i][0];
if (!url) continue;

const status = sheet.getRange(row, 6).getValue();
if (status === "✅ Done") continue;

sheet.getRange(row, 6).setValue(`🔁 (${i + 1} / ${urls.length})`);

try {
const result = inspectURLStatusFull_(url, token);
sheet.getRange(row, 2).setValue(result.coverage || "N/A");
sheet.getRange(row, 3).setValue(result.pageFetch || "N/A");
sheet.getRange(row, 4).setValue(result.lastCrawl || "N/A");
sheet.getRange(row, 5).setValue(result.robotsTxt || "N/A");

const perf = getPerformanceDataForUrl(url, token);
sheet.getRange(row, 7).setValue(perf.clicks);
sheet.getRange(row, 8).setValue(perf.impressions);
sheet.getRange(row, 9).setValue(perf.ctr);
sheet.getRange(row, 10).setValue(perf.position);

sheet.getRange(row, 6).setValue("✅ Done");
} catch (error) {
sheet.getRange(row, 2).setValue("❌ Error");
sheet.getRange(row, 6).setValue(error.message);
}

Utilities.sleep(1500);
}
}

function createJWT_(email, rawKey) {
const privateKey = rawKey.replace(/\\n/g, '\n');
const header = { alg: "RS256", typ: "JWT" };
const now = Math.floor(Date.now() / 1000);
const payload = {
iss: email,
scope: "https://www.googleapis.com/auth/indexing https://www.googleapis.com/auth/webmasters",
aud: "https://oauth2.googleapis.com/token",
exp: now + 3600,
iat: now
};
const encode = obj => Utilities.base64EncodeWebSafe(JSON.stringify(obj));
const toSign = encode(header) + "." + encode(payload);
const signature = Utilities.computeRsaSha256Signature(toSign, privateKey);
return toSign + "." + Utilities.base64EncodeWebSafe(signature);
}

function getAccessToken_(jwt) {
const options = {
method: "post",
payload: {
grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer",
assertion: jwt
}
};
const response = UrlFetchApp.fetch("https://oauth2.googleapis.com/token", options);
const json = JSON.parse(response.getContentText());
return json.access_token;
}
function inspectURLStatusFull_(url, token) {
const payload = {
inspectionUrl: url,
siteUrl: "https://www.antonioblago.com//", // <-- INSERT your GSC property here
languageCode: "en-US"
};
const options = {
method: "post",
contentType: "application/json",
headers: {
Authorization: `Bearer ${token}`
},
payload: JSON.stringify(payload),
muteHttpExceptions: true
};
const res = UrlFetchApp.fetch("https://searchconsole.googleapis.com/v1/urlInspection/index:inspect", options);
const data = JSON.parse(res.getContentText());
try {
const result = data.inspectionResult.indexStatusResult;
return {
coverage: result.coverageState,
pageFetch: result.pageFetchState,
lastCrawl: result.lastCrawlTime,
robotsTxt: result.robotsTxtState
};
} catch (e) {
return {
coverage: data.error?.message || "Error parsing",
pageFetch: "",
lastCrawl: "",
robotsTxt: ""
};
}
}

function getPerformanceDataForUrl(url, token) {
const endDate = new Date();
const startDate = new Date();
startDate.setDate(endDate.getDate() - 28);

const payload = {
startDate: Utilities.formatDate(startDate, Session.getScriptTimeZone(), "yyyy-MM-dd"),
endDate: Utilities.formatDate(endDate, Session.getScriptTimeZone(), "yyyy-MM-dd"),
dimensions: ["page"],
dimensionFilterGroups: [{
filters: [{
dimension: "page",
operator: "equals",
expression: url
}]
}],
rowLimit: 1
};

const options = {
method: "post",
contentType: "application/json",
headers: {
Authorization: `Bearer ${token}`
},
payload: JSON.stringify(payload),
muteHttpExceptions: true
};

const response = UrlFetchApp.fetch(
"https://searchconsole.googleapis.com/webmasters/v3/sites/sc-domain:deine-domain.tld/searchAnalytics/query",
options
);

const data = JSON.parse(response.getContentText());

if (data.rows && data.rows.length > 0) {
const row = data.rows[0];
return {
clicks: row.clicks,
impressions: row.impressions,
ctr: (row.ctr * 100).toFixed(2),
position: row.position.toFixed(1)
};
} else {
return {
clicks: 0,
impressions: 0,
ctr: "0.00",
position: "-"
};
}
}

✅ Result

The script processes each URL individually

Writes the indexing and performance data directly into your sheet

Already processed rows are skipped when restarted ( ✅ Done in column F)

Limitations

Maximum number of URL inspections per day: The Google Search Console API URL Inspection currently allows 2,000 requests per day and property.

Timeout after 30 minutes: Google Apps Script aborts after about 30 minutes (for Workspace accounts) – for hundreds of URLs, the script may need to be manually restarted multiple times.

URL inspection only for verified properties: Only URLs that belong to the registered GSC property (e.g., sc-domain:your-domain.tld) can be successfully checked.

Quota limitations of the Search Console API: Too many requests in a short time can lead to 429 errors – the script therefore has a sleep of 1.5 seconds integrated.

Premium SEO Automation: Indexing & Performance on Autopilot

Keep an eye on your most important pages – without manual tracking.

✅ Automated indexing monitoring Daily check of the indexing status of your top money pages. Instantly detect crawling issues or missing indexing.

✅ Intelligent SEO reports in Google Sheets All relevant KPIs such as clicks, impressions, CTR, and position automatically retrievable – clear and ready for further processing.

✅ Real-time sitemap synchronization New URLs are automatically detected, matched with the sitemap, and, if desired, sent directly to Google Search Console.

✅ Early warning system for traffic losses Instantly identify pages with declining performance – before rankings and revenue are affected.

✅ Daily reporting emails & performance logs Receive automated email reports including status overview, error log, and concrete action recommendations.

✅ No copy-paste, no CSV import All processes run automatically – ideal for larger shops and SEO teams focused on scaling.

✅ 100% GDPR-compliant & fully in your Google account No third-party tools, no data sharing – maximum security and control.

Whether for agencies or e-commerce teams

Automate what costs you time every day – and focus on what really matters: performance. Secure a demo now & automate SEO smartly – Book an appointment here

Set up Google Search Console

Set up Google Big Query

Fix 404 errors

Email campaign automations

Query search volume with Data4SEO

More questions or need help with setup?

I'm happy to help, just book a consultation appointment here: https://calendly.com/antonio-blago/intromeeting

Sign up here for my newsletter to not miss tips, tricks, and hacks about SEO, AI, and automation.

E-commerce SEO Case Study for PURELEI

E-commerce SEO Case Study: PURELEI.com +100% visibility in 8 months [...]

Case study, SEO

Case Study: How We Generated Over €1.2 Million in Revenue with Targeted Blog Content

Brief Overview
A fast-growing brand was able to generate over €1.2 million in revenue within 12 months through targeted content strategies and [...]

Automation, AI, SEO

Finally Accessible: Efficiently Filling ALT Texts with AI

5 (1) Practical Example in Shopify
In my job as an SEO freelancer [...]

Analysis, AI, SEO, SEO Tools

AI Prompt Keyword Mapper

0 (0) How to Automatically Analyze Prompts
Nowadays, prompts – that is, [...]

AI, AI Tools, SEO Tools

ChatGPT German: Use Chat GPT for Free Without Registration

[borlabs-cookie id="aichatbot" type="content-blocker"][/borlabs-cookie]
ChatGPT, the advanced language model from OpenAI, is revolutionizing the way [...]

SEO, Shopify

Part 2: Automating Shopify Redirects: Connecting Sitemaps, Excel & Matrixify with Python

0 (0) 📖 Part of a series: Why missing redirects cost you traffic [...]

 
Cookie-Settings