The nodejs ping_bing Module Makes Submitting a URL to Bing Simple, Easy and Automated
Earlier this spring, Microsoft Bing team announced a submission API [read more]. That is very valuable because now you can tell Bing about new and updated content or what I call Ping Bing.
This puts you in control of when you want the search engine to come crawl, evaluate and index content.
Since the API was announced I added the API to my normal rendering work-flow for all of the sites I manage. My sites are all static websites, rendered using a series of AWS Lambdas using nodejs.
Microsoft does have a C# SDK they support, which makes sense because it is a Microsoft technology.
There was not a nodejs module to use the Bing submission API. So I dedicded to port the code I use and release it a few weeks ago. I call it the Ping Bing module.
You can look it up on npmjs or just add it to your package.json file, "ping_bing". You can also install it using the npm CLI install command.
npm install --save ping_bing
The module itself is fairly simple to use. There's really just one method exposed, pingBing.
const pingBing = require( "ping_bing" ),
apiKey = "[Your API Key Here]",
siteUrl = "[Your Bing Verified Site URL (domain)]";
const singleURL = {
apiKey: apiKey,
siteUrl: siteUrl,
url: "[url to submit]"
};
pingBing.pingBing( singleURL )
.then( body => {
console.log( "success: ", body );
} )
.catch( err => {
console.log( "error: ", err );
} );
You can pass either a single URL or an array of URLs. The API was recently updated to allow bulk submissions, which the module automatically resolves.
const batchURLs = {
apiKey: apiKey,
siteUrl: siteUrl,
urlList: [ "[url to submit]", "[url to submit]", "[url to submit]" ]
};
pingBing.pingBing( batchURLs )
.then( body => {
console.log( "success: ", body );
} )
.catch( err => {
console.log( "error: ", err );
} );
Bulk submission makes it much easier for some sites who do many updates at one shot. Now you don't have to worry about calling it thousands and thousands of times.
There is a limit a daily limit of 10,000 URLs per site. For almost every website out there this daily limit is way more than needed.
And if you're wondering, yes, there are many sites who create lots of continent day and will meet and surpass that threshold. They do have a way for those sites to connect it to them to get their quota raised as needed.
If your web platform utilizes nodejs to publish and update content then my Ping Bing module should make your life a little easier. Please feel free to reach out and let me know if you have any issues with the module.
You can see the Ping Bing Node Module's details on NPM