Skip to content

NachoSEO/IndexNow-Nodejs-Wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IndexNow NodeJS Wrapper

NodeJS Wrapper for the IndexNow API.

Requeriments

Configuration

Go to src/config/indexNowConfig.js, you'll find the configuration for the IndexNow API:

You just need to replace the following values inside the payload:

  • host: The host of the website you want to index.
  • key: The API key of the website you want to index.
  • keyLocation: The location of the API key of the website you want to index.
  • urlList: The list of URLs you want to index.
  payload: {
    host: 'https://www.example.com', //Replace with your own domain
    key: '<apiKey>', // Replace with your own API key
    keyLocation: 'https://www.example.com/apiKey.txt', //Replace with your own API key location
    urlList: [ // Replace with your own URL list
      'https://www.example.org/url1',
      'https://www.example.org/folder/url2',
      'https://www.example.org/url3'
    ]
  }

Quickstart

When you have the configuration, you can execute the script with the following command:

yarn indexURLs

The terminal output would be the following:

  Error in submitting 1 URLs to https://yandex.com
  Possible reason: 422 - In case of URLs don’t belong to the host or the key is not matching the schema in the protocol
  1 URLs Submitted succesfully to https://www.bing.com

In this case we submitted 1 URL to Bing but not in Yandex because of an specific error (just for the sake of the example).

About

NodeJS Wrapper for the IndexNow API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published