Accessing Bing Webmaster Tools API using cURL

Thank you webmasters for effectively using Adaptive URL solution to notify bingbot about your website’s most fresh and relevant content. But, did you know you don’t have to use the Bing webmaster tools portal to submit URLs?

Bing webmaster tools exposes programmatic access to its APIs for webmasters to integrate their workflows. Here is an example using the popular command line utility cURL that shows how easy  it is to integrate the Submit URL single and Submit URL batch API end points. You can use Get url submission quota API to check remaining daily quota for your account.

Bing API can be integrated and called by all modern languages (C#, Python, PHP…), however, cURL can help you to prototype and test the API in minutes and also build complete solutions with minimal effort. cURL is considered as one of the most versatile tools for command-line API calls and is supported by all major Linux shells – simply run the below commands in a terminal window. If you're a Windows user, you can run cURL commands in Git Bash, the popular git client for Windows" (no need to install curl separately, Git Bash comes with curl).  If you are a Mac user, you can install cURL using a package manager such as Homebrew.

When you try the examples below, be sure to replace API_KEY with your API key string obtained from Bing webmaster tools > Webmaster API > Generate. Refer easy set-up guide for Bing’s Adaptive URL submission API for more details.
 

Submitting new URLs – Single

curl -X POST "https://ssl.bing.com/webmaster/api.svc/json/SubmitUrl?apikey=API_KEY" 
-H "Content-Type: application/json" 
-H "charset: utf-8" 
-d '{"siteUrl":"https://www.example.com", "url": "https://www.example.com/about"}'

Response:
{"d": null}

Submitting new URLs – Batch

curl -X POST “https://ssl.bing.com/webmaster/api.svc/json/SubmitUrlBatch?apikey=API_KEY” 
-H “Content-Type: application/json” 
-H “charset: utf-8” 
-d ‘{“siteUrl”:”https://www.example.com”, “urlList”:[“https://www.example.com/about”, “https://www.example.com/projects”]}’

Response:
{“d”:null}

Check remaining API Quota

curl “https://ssl.bing.com/webmaster/api.svc/json/GetUrlSubmissionQuota?siteUrl=https://www.example.com&apikey=API_KEY”

Response:
{
“d”: 
{“__type”: “UrlSubmissionQuota:#Microsoft.Bing.Webmaster.Api”,
“DailyQuota”: 973,
“MonthlyQuota”: 10973
}}
So, integrate the APIs today to get your content indexed real time by Bing. Please reach out to Bing webmaster tools support if you face any issues. 

Thanks,
Bing Webmaster Tools team
 
Share on twitter Share on facebook Share on linkedin Share on linkedin