Skip to main content

Lightweight Python package that makes it easy to submit URLs to the IndexNow API of various search engines

Project description

Latest version Python 3.10 | 3.11 | 3.12 | 3.13+ MIT license Codecov CodeQL Test Downloads

🔍 Submit URLs to the IndexNow API of Various Search Enginges 🔎

Are you concerned about search engine optimization (SEO)? Do you want to make sure your website is indexed frequently by Bing, Yandex, DuckDuckGo, and other search engines?

IndexNow for Python is a lightweight Python package that makes it easy to submit URLs or entire sitemaps to the IndexNow API of various search engines, so your pages can be indexed faster.

Ready to try? Learn how to install and find tutorials in the user guide.

Getting Started

Basic Usage and Submit Individual URLs

Firstly, ensure that you have an API key for IndexNow. Hereafter, add your authentication credentials to the IndexNowAuthentication class, which will be used throughout the examples. You can now submit individual URLs to the IndexNow API:

from index_now import submit_url_to_index_now, IndexNowAuthentication

authentication = IndexNowAuthentication(
    host="example.com",
    api_key="a1b2c3d4",
    api_key_location="https://example.com/a1b2c3d4.txt",
)

submit_url_to_index_now(authentication, "https://example.com/page1")

[!IMPORTANT] Instances of authentication = IndexNowAuthentication(...) below refer to this section:

authentication = IndexNowAuthentication(
    host="example.com",
    api_key="a1b2c3d4",
    api_key_location="https://example.com/a1b2c3d4.txt",
)

Submit Multiple URLs in Bulk

How to submit multiple URLs in bulk to the IndexNow API:

from index_now import submit_urls_to_index_now, IndexNowAuthentication

authentication = IndexNowAuthentication(...)

urls = ["https://example.com/page1", "https://example.com/page2", "https://example.com/page3"]

submit_urls_to_index_now(authentication, urls)

Submit Entire Sitemap

How to submit an entire sitemap to the IndexNow API:

from index_now import submit_sitemap_to_index_now, IndexNowAuthentication

authentication = IndexNowAuthentication(...)

sitemap_location = "https://example.com/sitemap.xml"

submit_sitemap_to_index_now(authentication, sitemap_location)

Submit to Specific Search Engines

How to use the default SearchEngineEndpoint options or a custom endpoint:

from index_now import submit_url_to_index_now, IndexNowAuthentication, SearchEngineEndpoint

authentication = IndexNowAuthentication(...)

endpoint_bing = SearchEngineEndpoint.BING
endpoint_custom = "https://example.com/indexnow"

for endpoint in [endpoint_bing, endpoint_custom]:
    submit_url_to_index_now(authentication, "https://example.com/page1", endpoint)

Become a Sponsor 🏅

If you find this project helpful, please consider supporting its development. Your donations will help keep it alive and growing. Every contribution, no matter the size, makes a difference.

Donate on GitHub Sponsors

Thank you for your support! 🙌

Contribute

If you have suggestions or changes to the module, feel free to add to the code and create a pull request.

Report Bugs

Report bugs and issues here.

MIT License

Copyright (c) 2025 – present, Jakob Bagterp

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

index_now_for_python-1.0.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

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

index_now_for_python-1.0.0-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: index_now_for_python-1.0.0.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for index_now_for_python-1.0.0.tar.gz
Algorithm Hash digest
SHA256 8bbc994460aebc701cc278c7babd2ca6bc8e9cfee31b9b06f92146889b0cb6e2
MD5 b00511ce6309257bfc4abd439ffd42c5
BLAKE2b-256 4497c51e01390fa805cedc27375584cc06d2804f6f95c5083ddba8e807b527f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for index_now_for_python-1.0.0.tar.gz:

Publisher: release.yml on jakob-bagterp/index-now-for-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for index_now_for_python-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 917a445c0ce937002ac1b059e53e7e71cc19d1d886930a08caee4b8569145803
MD5 e070d3f5d9b3d932de71bf6da81d2701
BLAKE2b-256 0540da1266ccc16d6bd74544bb4aafe9eb5b0f6b299147be84cd67eb659d384d

See more details on using hashes here.

Provenance

The following attestation bundles were made for index_now_for_python-1.0.0-py3-none-any.whl:

Publisher: release.yml on jakob-bagterp/index-now-for-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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