Skip to content

Submit Single URL to the IndexNow API#

submit_url_to_index_now()#

Submits a list of URLs to the IndexNow API of a search engine.

Parameters:

Name Type Description Default
authentication IndexNowAuthentication

Authentication credentials for the IndexNow API.

required
url str

URL to submit, e.g. "https://example.com/page1".

required
endpoint SearchEngineEndpoint | str

Select the search engine you want to submit to or use a custom URL as endpoint.

INDEXNOW
Example

After adding your authentication credentials to the IndexNowAuthentication class, you can now submit a single URL 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",
)

url = "https://example.com/page1"

submit_url_to_index_now(authentication, url)

If you want to submit to a specific search engine, alternatively customize the endpoint:

submit_url_to_index_now(authentication, url,
    endpoint="https://www.bing.com/indexnow")