Metadata-Version: 2.4
Name: index-now-for-python
Version: 1.0.23
Summary: Lightweight package that makes it easy to submit URLs to the IndexNow API of various search engines
Project-URL: Bug Tracker, https://github.com/jakob-bagterp/index-now-for-python/issues
Project-URL: Documentation, https://jakob-bagterp.github.io/index-now-for-python/
Project-URL: API Reference, https://jakob-bagterp.github.io/index-now-for-python/reference/
Project-URL: Source Code, https://github.com/jakob-bagterp/index-now-for-python
Project-URL: Release Notes, https://github.com/jakob-bagterp/index-now-for-python/releases
Author-email: Jakob Bagterp <jakob_bagterp@hotmail.com>
Maintainer-email: Jakob Bagterp <jakob_bagterp@hotmail.com>
License: MIT License
License-File: LICENSE.md
Keywords: bing,duckduckgo,index-now,python,seo,sitemap,yandex
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.11
Requires-Dist: colorist==1.8.12
Requires-Dist: lxml-stubs==0.5.1
Requires-Dist: lxml==6.1.0
Requires-Dist: requests==2.33.1
Requires-Dist: types-requests==2.32.4.20260107
Description-Content-Type: text/markdown

[![Latest version](https://img.shields.io/static/v1?label=version&message=1.0.23&color=yellowgreen)](https://github.com/jakob-bagterp/index-now-for-python/releases/latest)
[![Python 3.11 | 3.12 | 3.13 | 3.14+](https://img.shields.io/static/v1?label=python&message=3.11%20|%203.12%20|%203.13%20|%203.14%2B&color=blueviolet)](https://www.python.org)
[![MIT license](https://img.shields.io/static/v1?label=license&message=MIT&color=blue)](https://github.com/jakob-bagterp/index-now-for-python/blob/master/LICENSE.md)
[![Codecov](https://codecov.io/gh/jakob-bagterp/index-now-for-python/branch/master/graph/badge.svg?token=SGVMPJ1JWI)](https://codecov.io/gh/jakob-bagterp/index-now-for-python)
[![CodeQL](https://github.com/jakob-bagterp/index-now-for-python/actions/workflows/codeql.yml/badge.svg)](https://github.com/jakob-bagterp/index-now-for-python/actions/workflows/codeql.yml)
[![Test](https://github.com/jakob-bagterp/index-now-for-python/actions/workflows/test.yml/badge.svg)](https://github.com/jakob-bagterp/index-now-for-python/actions/workflows/test.yml)
[![Downloads](https://static.pepy.tech/badge/index-now-for-python)](https://pepy.tech/project/index-now-for-python)

# 🔍 Submit URLs to the IndexNow API of Various Search Engines 🔎
Are you concerned about search engine optimization (SEO)? Do you want to make sure your website is indexed frequently by [Bing](https://www.bing.com/indexnow), [Yandex](https://yandex.com/indexnow), [DuckDuckGo](https://duckduckgo.com/), and other search engines?

IndexNow for Python is a lightweight, yet powerful 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](https://jakob-bagterp.github.io/index-now-for-python/getting-started/installation/) and find tutorials in the [user guide](https://jakob-bagterp.github.io/index-now-for-python/user-guide/).

## Getting Started
### Basic Usage and Submit Individual URLs
Firstly, ensure that you have an [API key for IndexNow](https://jakob-bagterp.github.io/index-now-for-python/user-guide/tips-and-tricks/generate-api-keys/). 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:

```python
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:
>
> ```python
> 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:

```python
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:

```python
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:

```python
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 makes a difference, whether you buy a coffee or support with a monthly donation. Find your tier here:

[Donate on GitHub Sponsors](https://github.com/sponsors/jakob-bagterp)

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](https://github.com/jakob-bagterp/index-now-for-python/pulls).

## Report Bugs
If you encounter any issues, you can [report them as bugs or raise issues](https://github.com/jakob-bagterp/index-now-for-python/issues).
