Skip to main content

A bulk Google Search Console Indexing API submission utility

Project description

GSC Fast Indexer CLI 🚀

A lightweight, automated Python command-line tool to submit URLs to the Google Search Console Indexing API in bulk. Easily index single URLs, URLs listed in text files, or extract and crawl directly from online or local XML sitemaps.

This tool bypasses the standard slow crawl cycle by directly notifying Google's Indexing API of new or updated pages, reducing indexing times from weeks to minutes.


🛠️ Maintained & Funded By

This project is created and maintained by The DIGIT.

We are a precision-engineered digital product agency specializing in:

  • SaaS Product Development: Building responsive, fast, and scalable full-stack web applications.
  • Autonomous AI Automation: Implementing custom LLM-powered workflows to optimize business processes.
  • Technical SEO: Delivering advanced, analytics-driven site audits and performance optimizations.

Need help building your next SaaS or automating your indexing? Let's talk at thedigithq.com or reach us at business@thedigithq.com.


Features

  • Bulk Sitemap Parsing: Read and parse all <loc> elements from online/local sitemap.xml feeds.
  • Batch File Submissions: Feed a text file of URLs to be submitted sequentially.
  • Action Types: Supports URL_UPDATED (request crawling) and URL_DELETED (request removal).
  • Error Guidance: Detailed output troubleshooting permissions errors (a common blocker with GSC Service Accounts).

Prerequisites & Installation

1. Install Dependencies

Ensure you have Python 3 installed. Clone this repository, navigate to the directory, and install the requirements:

pip install -r requirements.txt

2. Set Up Google Indexing API Credentials (Required)

Google restricts access to its Indexing API to verified owners. Follow these steps to set up credentials:

  1. Create a Google Cloud Project: Go to the Google Cloud Console, and create a new project.
  2. Enable the API: Search for Google Indexing API and click Enable.
  3. Create a Service Account:
    • Navigate to IAM & Admin > Service Accounts.
    • Click Create Service Account (grant it a role like "Viewer" or leave it blank).
    • Copy the email address of the new Service Account (it looks like your-account@your-project.iam.gserviceaccount.com).
  4. Download JSON Key:
    • Click on the newly created Service Account.
    • Go to the Keys tab > Add Key > Create new key.
    • Choose JSON format and download the file.
    • Save it in the root folder of this project as credentials.json.
  5. Delegate GSC Ownership (Critical Step):
    • Open your Google Search Console.
    • Select your site property.
    • Go to Settings > Users and permissions.
    • Click Add User.
    • Paste the Service Account email address as the user, and set the Permission Level to Owner (Owner permissions are required to call the Indexing API).

Usage

Run the script by choosing one of the three input types:

Option A: Submit a Single URL

python indexer.py --url "https://thedigithq.com/blog/ai-workflows"

Option B: Submit URLs From a Sitemap

python indexer.py --sitemap "https://thedigithq.com/sitemap.xml"

Option C: Submit URLs From a Local File

Create a urls.txt with one URL per line:

https://thedigithq.com/services
https://thedigithq.com/about

Then run:

python indexer.py --file urls.txt

Options and Flags

  • -c, --credentials: Path to the service account credentials JSON (default: credentials.json).
  • -t, --type: Action type, either URL_UPDATED or URL_DELETED (default: URL_UPDATED).

License

Licensed under the MIT License. Feel free to fork, modify, and use this tool in your own CI/CD pipelines.


Need custom technical SEO workflows built? Partner with The DIGIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thedigit_gsc_indexer-1.0.0.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

thedigit_gsc_indexer-1.0.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file thedigit_gsc_indexer-1.0.0.tar.gz.

File metadata

  • Download URL: thedigit_gsc_indexer-1.0.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for thedigit_gsc_indexer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 53c315407d7b407ee5e466fe72af8358781287887013d4b0a79aa3f311cd41b5
MD5 8ada003f1e595585cb23556f57fa5db9
BLAKE2b-256 889677257f7538bfc20e63179599343f7bb06232fef0a4a999d698fd418adfc4

See more details on using hashes here.

File details

Details for the file thedigit_gsc_indexer-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for thedigit_gsc_indexer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8e365f3dc98ebf7aea0c0cdd83646d9519027e5fcd8c1c8903ade268499afaf1
MD5 5b329ddba88ef27b85ac537ae71ae6cc
BLAKE2b-256 a33a330761c2ede1225d7fb3af7ad7d9c6a2f52a3410fee62d39368f11b11b38

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page