Post

Introducing IndexNow Submitter: Fast Search Engine Indexing

Introducing IndexNow Submitter, an npm module I created to boost your node app's SEO with faster indexing using IndexNow protocol.

In the fast-paced world of web development and SEO, keeping search engines up-to-date with your latest content is crucial. That’s why I’m excited to introduce IndexNow Submitter, a powerful npm module designed to simplify and automate the process of submitting URLs to search engines using the IndexNow protocol.

Why IndexNow Submitter?

Search engine optimization is an ongoing battle. You work hard to create great content, but if search engines don’t know about it, your efforts might go unnoticed. The IndexNow protocol aims to solve this problem by allowing websites to instantly notify search engines about new or updated content. However, implementing this protocol manually can be time-consuming and error-prone.

That’s where IndexNow Submitter comes in. This npm module provides a simple, efficient, and flexible way to submit your URLs to search engines, ensuring that your content gets indexed as quickly as possible.

The IndexNow protocol is implemented by several major search engines like bing (and therefore, duckduckgo), yandex, naver, seznam.cz and yz. However, google has not implement it yet.

Key Features

  • Single and Batch URL Submission: Submit individual URLs or batches of URLs with ease.
  • Sitemap Parsing: Automatically extract and submit URLs from your XML sitemaps.
  • Caching: Avoid redundant submissions with built-in caching.
  • Analytics: Track your submission statistics to optimize your indexing strategy.
  • Rate Limiting: Comply with search engine guidelines by controlling submission rates.
  • CLI Support: Use as a module in your Node.js projects or as a command-line tool.
  • TypeScript Support: Enjoy full TypeScript support for a better development experience.

Getting Started

To start using IndexNow Submitter, you can install it via npm:

1
npm install indexnow-submitter

Basic Usage

Here’s a simple example of how to use IndexNow Submitter in your Node.js project:

1
2
3
4
5
6
7
8
9
10
11
import { IndexNowSubmitter } from 'indexnow-submitter';

const submitter = new IndexNowSubmitter({
  key: 'your-indexnow-api-key',
  host: 'your-website.com'
});

// Submit a single URL
submitter.submitSingleUrl('https://your-website.com/new-page')
  .then(() => console.log('URL submitted successfully'))
  .catch(error => console.error('Error submitting URL:', error));

Submitting Multiple URLs

Need to submit multiple URLs at once? No problem:

1
2
3
4
5
6
7
8
9
const urls = [
  'https://your-website.com/page1',
  'https://your-website.com/page2',
  'https://your-website.com/page3'
];

submitter.submitUrls(urls)
  .then(() => console.log('URLs submitted successfully'))
  .catch(error => console.error('Error submitting URLs:', error));

Parsing and Submitting from a Sitemap

If you have a sitemap, IndexNow Submitter can parse it and submit all the URLs for you:

1
2
3
submitter.submitFromSitemap('https://your-website.com/sitemap.xml')
  .then(() => console.log('Sitemap URLs submitted successfully'))
  .catch(error => console.error('Error submitting sitemap URLs:', error));

You can even specify a date to only submit URLs that have been modified since then:

1
2
3
4
const modifiedSince = new Date('2023-01-01');
submitter.submitFromSitemap('https://your-website.com/sitemap.xml', modifiedSince)
  .then(() => console.log('Recent sitemap URLs submitted successfully'))
  .catch(error => console.error('Error submitting recent sitemap URLs:', error));

Command-Line Interface

IndexNow Submitter also comes with a CLI, making it easy to use in your scripts or CI/CD pipelines:

1
2
3
4
5
6
7
8
# Submit a single URL
INDEXNOW_KEY=your-api-key INDEXNOW_HOST=your-website.com npx indexnow-submitter submit https://your-website.com/new-page

# Submit URLs from a file (keep single url in each line)
INDEXNOW_KEY=your-api-key INDEXNOW_HOST=your-website.com npx indexnow-submitter submit-file urls.txt

# Submit URLs from a sitemap
INDEXNOW_KEY=your-api-key INDEXNOW_HOST=your-website.com npx indexnow-submitter submit-sitemap https://your-website.com/sitemap.xml

Advanced Features

Caching

IndexNow Submitter includes an intelligent caching system to prevent redundant submissions. This is particularly useful when you’re running regular indexing jobs:

1
2
3
4
5
6
7
8
9
10
11
const submitter = new IndexNowSubmitter({
  key: 'your-api-key',
  host: 'your-website.com',
  cacheTTL: 3600 // Cache URLs for 1 hour
});

// This URL will be submitted
await submitter.submitSingleUrl('https://your-website.com/page1');

// This won't be submitted again within the next hour
await submitter.submitSingleUrl('https://your-website.com/page1');

Analytics

Want to know how your submissions are performing? IndexNow Submitter provides built-in analytics:

1
2
3
4
5
6
7
8
9
10
const analytics = submitter.getAnalytics();
console.log('Submission analytics:', analytics);

// Output:
// Submission analytics: {
//   totalSubmissions: 100,
//   successfulSubmissions: 98,
//   failedSubmissions: 2,
//   averageResponseTime: 250
// }

Use Cases

  1. E-commerce Sites: Automatically submit new product pages or updated inventory pages to ensure search engines quickly index your latest offerings.

  2. News Websites: Instantly notify search engines about breaking news articles to improve their visibility in search results.

  3. Blogs: Submit new blog posts as soon as they’re published to accelerate their indexing and potential organic traffic.

  4. Large Websites: Use the sitemap parsing feature to easily submit all URLs from your sitemap, ensuring your entire site stays freshly indexed.

  5. Development Workflows: Integrate IndexNow Submitter into your CI/CD pipeline to automatically submit URLs of newly deployed or updated pages.

Conclusion

IndexNow Submitter simplifies the process of keeping search engines up-to-date with your website’s content. Whether you’re managing a small blog or a large e-commerce site, this npm module provides the tools you need to ensure your content gets indexed quickly and efficiently.

By leveraging the IndexNow protocol and providing features like batch submissions, sitemap parsing, and intelligent caching, IndexNow Submitter helps you optimize your SEO efforts and potentially improve your search engine rankings.

Give IndexNow Submitter a try in your next project, and experience the benefits of faster indexing and improved search engine visibility!


You can find the full documentation and source code on GitHub, and the package is available on npm. If you have any questions or feedback, feel free to open an issue or contribute to the project. Happy indexing!

This post is licensed under CC BY 4.0 by the author.

Comments powered by Disqus.