Skip to main content

indexnow-ping

CI PyPI Python License: Apache-2.0

Tell the search engines your site changed — without accidentally announcing a site that isn't live yet.

indexnow-ping reads a site's own sitemap.xml, then submits through IndexNow and optionally Google Search Console:

  • IndexNow — pings api.indexnow.org, which fans out to Bing, Yandex and Seznam.
  • Google Search Console — resubmits the sitemap via the GSC API.

Before it pings anything it runs a pre-launch guard: it fetches robots.txt and aborts if the site still blocks every crawler (User-agent: * + Disallow: /). Staging and not-yet-launched sites therefore can't be leaked to the index by a stray cron run. That guard is the reason this exists.

pip install indexnow-ping                 # IndexNow only (pure standard library)
pip install "indexnow-ping[gsc]"          # + Google Search Console support

Use

# IndexNow ping; key read from a file or the environment
indexnow-ping example.com --indexnow-key-file /etc/indexnow/example.key
INDEXNOW_KEY=abc123... indexnow-ping example.com

# also resubmit the sitemap to Google Search Console
indexnow-ping example.com \
  --indexnow-key-file /etc/indexnow/example.key \
  --gsc-key-file /etc/gsc/service-account.json

# a pre-launch site (robots blocks all) exits 1 and pings nothing:
indexnow-ping staging.example.com --indexnow-key K   # -> GUARD: ... abort ; exit 1
#   override deliberately with --force

The IndexNow key is a token you also serve at https://<domain>/<key>.txt; it is not a secret, but keep it out of your repo (a --indexnow-key-file / INDEXNOW_KEY is cleaner than a flag in shell history). The GSC service-account JSON is sensitive — pass a path, never commit it.

Options

Flag / env Meaning
--sitemap URL sitemap URL (default https://<domain>/sitemap.xml; must be same-site)
--indexnow-key / --indexnow-key-file / INDEXNOW_KEY / INDEXNOW_KEY_FILE the IndexNow key
--gsc-key-file / GSC_KEY_FILE Google service-account JSON (enables the GSC layer)
--limit N max URLs to submit (default 200)
--timeout S per-request timeout
--force skip the pre-launch robots guard

Exit codes: 0 submitted, 1 pre-launch guard aborted, 2 usage error, 3 ran but nothing submitted (no key/URLs, unavailable sitemap, or all submissions failed).

Design notes

  • Guard fails closed. If robots.txt can't be fetched, or blocks all crawlers, the run aborts rather than pinging.
  • Same-site only. Every URL — and every child sitemap in a sitemap-index — is checked to belong to the target host before it is followed or submitted, so a tampered sitemap can't make the tool ping arbitrary hosts. A sitemap-index is followed one level; its child-sitemap links are never mistaken for page URLs.
  • URLs come from the site. The tool never invents URLs; it submits exactly what the sitemap lists (capped by --limit). A valid but empty sitemap submits nothing, and an unavailable sitemap is not treated as an empty one — it aborts the IndexNow submission rather than announcing a synthesized URL.
  • Redirects stay on-site. HTTP redirects for robots.txt and sitemaps are followed only within the target site; a cross-origin redirect is an error, so a redirecting endpoint cannot bypass the guard or point the tool at another host.
  • Optional heavy dep. IndexNow is standard-library only; the Google client is imported lazily and required solely for the GSC layer.

Tests

pip install -e ".[dev]"
pytest -q

The suite injects a fake fetcher and stubs the HTTP calls, so it exercises the real guard/parsing/same-site/flow logic with no network access.

License

Apache-2.0.

Built and maintained by Gexiro Global Enterprises Ltd.

Third-party service and library attribution: see NOTICE.

Part of the Gexiro open-source toolkit.

Metadata

Release files for indexnow-ping 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for indexnow-ping 0.1.1
File Size Uploaded
indexnow_ping-0.1.1.tar.gz 21.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for indexnow-ping 0.1.1
File Interpreter ABI Platform
indexnow_ping-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 39.5 kB

Release files / indexnow_ping-0.1.1.tar.gz

Download URL indexnow_ping-0.1.1.tar.gz
Size 21.9 kB
Tags Source
SHA-256 checksum
How to use checksums
57f45c9f6fdebca762c6efc018d1eaef28174a5c73e8874240a4888625a0f8f7
BLAKE2b-256 checksum
How to use checksums
5996cac44a87e63db1bf8e0d5bb5a4d42d747675872182dc2a52d12a574d94c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.

Transparency log

Release files / indexnow_ping-0.1.1-py3-none-any.whl

Download URL indexnow_ping-0.1.1-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45d44e792946192370b5393db2003c333cd5029dd1b9617fb20f92da3f8e1073
BLAKE2b-256 checksum
How to use checksums
c274cf0819cd94499fd6a9a44be4e7b67b0be648aea58c2d7151b2be4567c5c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page