Complete Guide to IndexNow API Integration

Learn how to implement both single and bulk URL submission for faster indexing

Introduction to IndexNow

IndexNow is a protocol that allows website owners to instantly notify search engines when content is added, updated, or deleted. Supported by Bing, Yandex, and other search engines, it significantly reduces the time between content publication and indexing.

Key Benefits:

  • Near-instant crawling of new content
  • Simple API integration
  • Free to use with no rate limits (within reason)
  • Supported by multiple search engines

Prerequisites

1. Verify Your Website

Before using IndexNow, you must verify ownership of your website in:

2. Generate or Create Your API Key

You have two options to obtain your IndexNow key:

Option A: Generate via Bing Webmaster Tools

  1. Go to Bing Webmaster ToolsConfigure My SiteIndexNow
  2. Click "Generate API Key"
  3. Copy the key (format: 32-character hexadecimal string)

Option B: Create Manually

  1. Generate a random key (e.g., using RandomKeygen)
  2. Create a text file named {key}.txt (e.g., d9a7e8f1b6c4d3e2f9a8b7c6d5e4f3a2.txt)
  3. Place the file in your website's root directory with the key as its only content

Important: The key file must be publicly accessible at https://yourdomain.com/{key}.txt

Implementation Methods

Single URL
Bulk URL
Postman

Single URL Submission (GET Request)

Use this method for submitting individual URLs when content changes are infrequent.

API Endpoint

GET https://api.indexnow.org/IndexNow

Request Parameters

Parameter Required Description Example
url Yes The URL to be indexed https://example.com/new-page
key Yes Your IndexNow API key d9a7e8f1b6c4d3e2f9a8b7c6d5e4f3a2

Example Implementation

cURL Command
curl -X GET "https://api.indexnow.org/IndexNow?url=https://www.example.org/new-article&key=d9a7e8f1b6c4d3e2f9a8b7c6d5e4f3a2"
JavaScript (Node.js)
const axios = require('axios');

const url = 'https://www.example.org/new-article';
const key = 'd9a7e8f1b6c4d3e2f9a8b7c6d5e4f3a2';

axios.get(`https://api.indexnow.org/IndexNow?url=${encodeURIComponent(url)}&key=${key}`)
  .then(response => {
    console.log('Submission successful:', response.status);
  })
  .catch(error => {
    console.error('Error:', error.response.status);
  });
Expected Response

Status Code: 200 OK or 202 Accepted

Body: Empty (no content)

Bulk URL Submission (POST Request)

Use this method for submitting multiple URLs at once, ideal for site migrations or content updates.

API Endpoint

POST https://api.indexnow.org/IndexNow

Request Body (JSON)

Field Required Description Example
host Yes Your domain (without protocol) www.example.org
key Yes Your IndexNow API key d9a7e8f1b6c4d3e2f9a8b7c6d5e4f3a2
keyLocation No* Full URL to key file (required if not at root) https://www.example.org/keys/mykey.txt
urlList Yes Array of URLs to submit (max 10,000/day) ["https://www.example.org/url1", "https://www.example.org/url2"]

*keyLocation is optional if your key file is at https://{host}/{key}.txt

Example Implementation

cURL Command
curl -X POST "https://api.indexnow.org/IndexNow" \
-H "Content-Type: application/json" \
-d '{
  "host": "www.example.org",
  "key": "d9a7e8f1b6c4d3e2f9a8b7c6d5e4f3a2",
  "keyLocation": "https://www.example.org/d9a7e8f1b6c4d3e2f9a8b7c6d5e4f3a2.txt",
  "urlList": [
    "https://www.example.org/new-page-1",
    "https://www.example.org/new-page-2"
  ]
}'
Python Script
import requests

url = "https://api.indexnow.org/IndexNow"
payload = {
    "host": "www.example.org",
    "key": "d9a7e8f1b6c4d3e2f9a8b7c6d5e4f3a2",
    "keyLocation": "https://www.example.org/d9a7e8f1b6c4d3e2f9a8b7c6d5e4f3a2.txt",
    "urlList": [
        "https://www.example.org/new-page-1",
        "https://www.example.org/new-page-2"
    ]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)
print("Status Code:", response.status_code)
print("Response:", response.text)
Expected Response

Status Code: 202 Accepted

Body: Empty (no content)

Postman Setup Guide

Test the IndexNow API easily using Postman with these configurations.

1. Create a New Request

  1. Open Postman and click "New""HTTP Request"
  2. Set the method to POST
  3. Enter the URL: https://api.indexnow.org/IndexNow

2. Configure Headers

Go to the "Headers" tab and add:

Key Value
Content-Type application/json
Host api.indexnow.org

3. Set Request Body

  1. Go to the "Body" tab
  2. Select "raw" and "JSON"
  3. Paste your JSON payload:
{
  "host": "www.example.org",
  "key": "d9a7e8f1b6c4d3e2f9a8b7c6d5e4f3a2",
  "keyLocation": "https://www.example.org/d9a7e8f1b6c4d3e2f9a8b7c6d5e4f3a2.txt",
  "urlList": [
    "https://www.example.org/url1",
    "https://www.example.org/url2"
  ]
}

4. Send the Request

Click "Send" and check the response:

  • 200/202: Success (URLs queued for indexing)
  • 400: Invalid request (check JSON format)
  • 403: Authentication failed (verify key)

Troubleshooting Common Issues

Issue Possible Cause Solution
202 Accepted but URLs not indexed Indexing takes time (not immediate) Wait 24-48 hours and check Bing Webmaster Tools
403 Forbidden Invalid API key or key file inaccessible Verify key file exists at the specified URL
400 Bad Request Invalid JSON or missing required fields Check request body for errors
404 Not Found Key file missing from website root Upload {key}.txt to your domain's root

Pro Tip: Use IndexNow Validator to test your key file setup.

Best Practices

Conclusion

Implementing IndexNow can dramatically improve your website's visibility in search engines by reducing the time between content updates and indexing. Whether you choose single URL submissions for occasional updates or bulk submissions for major changes, the API provides a simple yet powerful way to communicate directly with search engines.

Next Steps:

  1. Generate your API key and verify the key file
  2. Test with a few URLs using Postman or cURL
  3. Implement automated submissions in your CMS or publishing workflow
  4. Monitor results in Bing Webmaster Tools

Video Tutorial

Watch this step-by-step tutorial to see IndexNow API implementation in action:

This 10-minute tutorial walks you through the complete IndexNow API integration process.

Warning!
This website has enhanced security measures in place.
For access to the source code, contact: rr@edutechrr.com