
In this Azure tutorial, we will discuss the Bing Search API JavaScript Example.
Azure Cognitive Services Bing Search API is one of the excellent services from Microsoft that actually helps you implement Intelligent search in your application. This Search API helps you implement the search capability that can get web search results from billions of web pages, Images, Videos, news, etc.
As part of this Example, we will perform the below activities
- Create Azure Cognitive Services Bing Search API in Azure Portal
- Create An ASP.NET Web Application Using Visual Studio 2019 and We will use the Bing Search API key.
Prerequisites
Below are the Prerequisites needed here to implement the Azure Cognitive Services Bing Search API as part of this example.
- You must have a valid Azure subscription or a valid Azure Account. If you don’t have an Azure Account till now, you can Create a Free Azure Account now.
- You will have to install Visual Studio 2019 on your development machine. If you haven’t installed Visual Studio 2019 yet. Download and Install the Visual Studio 2019 on your dev machine now.
Now, assuming that you are ready with all the Prerequisites, let’s start the actual development here.
Create Azure Cognitive Services Bing Search API in Azure Portal
Follow the below steps.
1. Log in to the Azure Portal (https://portal.azure.com/)
2. Once you log in to the Azure Portal, search for Bing Search and click on the search result Bing Search under the Marketplace, as highlighted below.

Or, for the same option, you can click on the + Create a Resource button from the left navigation and then on the New window, search for the Bing Search and click on the search result Bing Search as highlighted below

3. Now click on the Create button on the next window, as highlighted below

4. On the Create window, Provide the details as shown below
- Name: Provide a unique name for the Azure Cognitive Services Bing Search API.
- Subscription: Choose a valid subscription to use to create the Azure Cognitive Services Bing Search API.
- Pricing tier: You can choose the pricing tier based on your requirements. For the Demo purpose, you can choose the Free F1 pricing tier, which will provide 3 calls per second and 1k calls per month. You can click on the View full pricing details link to learn more about the pricing structure.
- Resource Group: You can select the Existing Resource Group or you can click on the Create new link to create a new Resource Group.
- Read the notice properly and accept the same by selecting the checkbox as shown below.
5. Finally, click on the Create button Create Azure Cognitive Services Bing Search API.

The deployment was completed successfully without any issues. Click on the Go to resource button to navigate to the Azure Cognitive Services Bing Search API that we have created now.

Below is the Azure Cognitive Services Bing Search API that we have created just now.

The next step is to copy the key value of the Azure Cognitive Services Bing Search API. To copy the key value, click on the Keys and Endpoint link from the left navigation. Now, you can see the key1 and key2 values on the right side. Click the Show keys button to see the key values. Click on the copy button next to the Key1 value, and then keep that key value in a notepad, as we are going to use this key value in our next steps.
You can also click on the Regenerate key1 or Regenerate Key2 button to generate a new value for key1 or key2 if you want to use a new key value instead of the old one.

Now, we are done with the steps to Create the Azure Cognitive Services Bing Search API in the Azure Portal. The next step is to create a Windows application that will consume the API that we created above.
Create An ASP.NET Web Application Using Visual Studio 2019
Follow the below steps to create an ASP.NET Web Application in Visual Studio 2019.
1. Open Visual Studio 2019 and click the Create a new project button in the Getting Started window.
2. The next step is to select the Project template. Select ASP.NET Web Application (.NET Framework) as the project template and then click on the Next button.
