submit indexnow
Guides

Easy Submit IndexNow URL’s Using Python (7-Step-Guide)

Submit IndexNow URL’s easily by using a simple python script, learn how on this quick guide. IndexNow is a API protocol that lets you instantly notify search engines like Bing and Yandex on updated content posted in your website. Instead of waiting for crawlers to find your pages, you push the links directly in seconds. This guide shows you exactly how to do it using a simple Python script on windows and mac using the IndexNow API.

What You Need to Submit IndexNow URL’s

I’ll be guiding every step, after reading this easy guide I promise you will easily submit IndexNow URL’s.

  • Python: the programming language that runs the script (python.org)
  • pip: Python’s package installer (comes bundled with Python)
  • requests library: a Python add-on that lets your script send HTTP requests
  • Your IndexNow key: generated from your site or Bing Webmaster Tools
  • Your key file hosted: a .txt file with your key placed at the root of your site (e.g. https://yoursite.com/yourkey.txt)
  • Command Prompt (Windows) or Terminal (Mac/Linux)

Step 1: Get your IndexNow API Key

Register your website with Bing Webmaster Tools.

Go to https://www.bing.com/indexnow/getstarted and scroll down until you find this:

indexnow api key
IndexNow API key page.

Click on the download button (highlighted on the image). Now you have your IndexNow API key.

Step 2: Host the IndexNow API Key on your site

1: Host the IndexNow API key at the root of your website: Simply upload the file you previously downloaded to the root of your website, usually the public_html.

It should look something like this, but with your own API key: https://www.example.com/c5f8e345d47f40d49dafa7269d33b7d7.txt 

indexnow api host
IndexNow API hosted on a website.

Step 3: Install Python

Go to python.org/downloads and download the latest version:

python transfer page
Python download page.

Critical: When asked type “Y” on“Add to PATH” and press Enter. Skipping this step is the most common cause of errors.

indexnow add to path installation
Python add to path installation, type Y and press Enter to continue.

Type Y and press Enter on the other questions (recommended) to finish the installation:

python successfully instaled
Python installation completed.

This screen means Python was successfully installed on your computer. You can close the window now.

Step 4: Install the Requests Library

Open Command Prompt on Windows (press Windows + R, type cmd, hit Enter) or Terminal on Mac (press Cmd + Space, type Terminal).

Copy the following and hit Enter:

pip install requests

You only need to do this once. If pip is not recognized, try:

py -m pip install requests

Step 5: Create the Python Script

Open Notepad (or any text editor) and paste the following code:

import requests
import json

payload = {
    "host": "www.yoursite.com",
    "key": "your-indexnow-key",
    "keyLocation": "https://www.yoursite.com/your-indexnow-key.txt",
    "urlList": [
        "https://www.yoursite.com/page-1/",
        "https://www.yoursite.com/page-2/",
        "https://www.yoursite.com/page-3/"
    ]
}

headers = {
    "Content-Type": "application/json; charset=utf-8"
}

response = requests.post(
    "https://api.indexnow.org/indexnow",
    headers=headers,
    data=json.dumps(payload)
)

print(f"Status Code: {response.status_code}")

if response.status_code == 200:
    print("βœ… Success! All URLs submitted to IndexNow.")
elif response.status_code == 202:
    print("⏳ Accepted β€” key not yet verified.")
elif response.status_code == 403:
    print("❌ Key not found. Check your keyLocation URL.")
elif response.status_code == 422:
    print("❌ Invalid request β€” check your URLs match the host.")
else:
    print("⚠️ Unexpected response.")

Replace the following with your own details:

  • www.yoursite.com β†’ your domain
  • your-indexnow-key β†’ your actual key
  • The urlList β†’ the pages you want to submit

Save the file as indexnow.py on your Desktop. In Notepad, set Save as type to All Files before saving:

saving indexnow python script
Saving IndexNow Python script to desktop.

Important: For this to work, the file must ONLY be saved on the Desktop and it must be called “indexnow.py”.

Step 6: Run the Script to Submit IndexNow URL’s

In Command Prompt or Terminal, run the following commands one at a time:

Windows:

Copy the following and hit Enter:

cd %USERPROFILE%\Desktop

Then Copy the following and hit Enter:

python indexnow.py

Mac/Linux:

Copy the following and hit Enter:

cd ~/Desktop
python3 indexnow.py

Step 7: Check the IndexNow Result

If everything is set up correctly, you will see:

Status Code: 200
βœ… Success! All URLs submitted to IndexNow.
submit to indexnow successfully
IndexNow URL’s submit success.

Your URLs are now submitted to api.indexnow.org, which automatically distributes them to all participating search engines including Bing, Yandex, Naver, and Seznam in a single request.

CodeMeaning
200URLs accepted successfully
202Request received, key pending verification
400Bad request, check your JSON format
403Key file not found at the keyLocation URL
422URLs do not match the declared host

IndexNow Submission Tips

  • You can add up to 10,000 URLs per request.
  • Re-run the script anytime you publish or update pages.
  • You only need to submit to one endpoint and IndexNow shares URL’s with all partner engines automatically.

Conclusion

Submiting IndexNow URL’s can be tricky even for the most experienced, mostly because of the PATH issue during Python installation. Once that was sorted, the script ran on the first try. If you run into the same problem, just make sure you tick “Add Python to PATH” during setup and you will save yourself a headache.

The whole point of this approach is that you are not waiting around for Bing or Yandex to crawl your site on their own schedule. You submit IndexNow URL’s, get the 200 response, and the job is done. Add new pages to the urlList whenever you publish something and run it again.

Leave a Reply

Your email address will not be published. Required fields are marked *

back to top
We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners. View more
Cookies settings
Accept
Decline
Privacy & Cookie policy
Privacy & Cookies policy
Cookie name Active

Who we are

Our website address is: https://webtraffic.blog.

Comments

When visitors leave comments on the site we collect the data shown in the comments form, and also the visitor’s IP address and browser user agent string to help spam detection. An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it. The Gravatar service privacy policy is available here: https://automattic.com/privacy/. After approval of your comment, your profile picture is visible to the public in the context of your comment.

Media

If you upload images to the website, you should avoid uploading images with embedded location data (EXIF GPS) included. Visitors to the website can download and extract any location data from images on the website.

Cookies

If you leave a comment on our site you may opt-in to saving your name, email address and website in cookies. These are for your convenience so that you do not have to fill in your details again when you leave another comment. These cookies will last for one year. If you visit our login page, we will set a temporary cookie to determine if your browser accepts cookies. This cookie contains no personal data and is discarded when you close your browser. When you log in, we will also set up several cookies to save your login information and your screen display choices. Login cookies last for two days, and screen options cookies last for a year. If you select "Remember Me", your login will persist for two weeks. If you log out of your account, the login cookies will be removed. If you edit or publish an article, an additional cookie will be saved in your browser. This cookie includes no personal data and simply indicates the post ID of the article you just edited. It expires after 1 day.

Embedded content from other websites

Articles on this site may include embedded content (e.g. videos, images, articles, etc.). Embedded content from other websites behaves in the exact same way as if the visitor has visited the other website. These websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with that embedded content, including tracking your interaction with the embedded content if you have an account and are logged in to that website.

Who we share your data with

If you request a password reset, your IP address will be included in the reset email.

How long we retain your data

If you leave a comment, the comment and its metadata are retained indefinitely. This is so we can recognize and approve any follow-up comments automatically instead of holding them in a moderation queue. For users that register on our website (if any), we also store the personal information they provide in their user profile. All users can see, edit, or delete their personal information at any time (except they cannot change their username). Website administrators can also see and edit that information.

What rights you have over your data

If you have an account on this site, or have left comments, you can request to receive an exported file of the personal data we hold about you, including any data you have provided to us. You can also request that we erase any personal data we hold about you. This does not include any data we are obliged to keep for administrative, legal, or security purposes.

Where your data is sent

Visitor comments may be checked through an automated spam detection service.

Save settings