Auto-submit URLs from
sitemap.xmlto Google Search Console via the Google Indexing API.
- 🔍 Fetches URLs from
sitemap.xml(supports nested/index sitemaps) - 🚀 Submits URLs to Google Indexing API for indexing
- 📊 CSV-based database to track submissions and avoid duplicates
- 🔄 Failed URLs can be retried by re-running the command
- ⚡ Full async I/O for sitemap fetching
- 🎨 Beautiful colored terminal output with Rich
- 🛡️ Auto-retry with exponential backoff on rate limiting
- 📝 Detailed logging (verbose mode available)
- Python 3.10+ and uv package manager
- Google Cloud Project with the Web Search Indexing API enabled
- Service Account with a JSON key file (create one here)
- Add the Service Account email as Owner in Google Search Console → Settings → Users and permissions
# Clone the repository
git clone https://github.com/halimkun/gsc-auto-indexing.git
cd gsc
# Install dependencies
uv sync
# Copy and edit config
cp config.conf.example config.conf
# Edit config.conf and set the path to your service account JSON file# Submit all URLs from a domain's sitemap
uv run python main.py example.com
# Submit from a specific sitemap URL
uv run python main.py https://example.com/sitemap-articles.xml
# Use custom config and database paths
uv run python main.py example.com --config /path/to/config.conf --db /path/to/db.csv
# Enable verbose logging
uv run python main.py example.com -v╭─────────────────────────────────────╮
│ GSC Auto Submit │
│ Domain: example.com │
╰───────────────────── by @halimkun ─╯
✓ Configuration loaded
✓ Database loaded — 0 existing records
✓ Sitemap fetched — 22 URLs found
→ 22 new URLs to submit
✓ Connected to Google Indexing API
[1/22] ✓ https://example.com/page-1
[2/22] ✓ https://example.com/page-2
[3/22] ✗ https://example.com/page-3 — HTTP 403 — Permission denied
...
📊 Summary
Domain example.com
Total from sitemap 22
Skipped 0
Submitted 22
✓ Success 21
✗ Failed 1
⚠ 1 URLs failed. Re-run the command to retry.
github.com/halimkun/gsc
gsc/
├── main.py # Entry point + CLI
├── pyproject.toml # Dependencies & metadata
├── config.conf.example # Config template
├── LICENSE # MIT License
├── data/
│ └── submissions.csv # CSV database (auto-created)
└── src/
├── core/
│ ├── config.py # Config loader
│ └── logger.py # Rich logging setup
├── models/
│ └── submission.py # SubmissionRecord dataclass
└── services/
├── database.py # CSV database handler (upsert)
├── sitemap.py # Async sitemap parser
└── search_console.py # Google Indexing API client
- Parse the domain/URL argument
- Load Google credentials from
config.conf - Load existing submission records from CSV database
- Fetch all URLs from
sitemap.xml(recursively follows nested sitemaps) - Filter out URLs already successfully submitted
- Submit new URLs to Google Indexing API (with 1s delay between requests)
- Save results to CSV database (upsert — updates existing, appends new)
- Display summary with colored output
- Google Indexing API Quota: 200 requests per day by default. The tool includes auto-retry with exponential backoff for rate limiting.
- Service Account as Owner: The Service Account must be added as Owner (not just user) in Google Search Console for the Indexing API to work.
- URL Types: The Indexing API officially supports
JobPostingandBroadcastEventschema types, but is widely used for all URL types by SEO tools.
MIT License — see LICENSE for details.
halimkun — github.com/halimkun