After Google web search API getting depreciated, Bing Search API is probably the best option to embed web search functionality into your website. Lets us have a glance over the steps to integrate Bing Web Search API.
First open the Bing Search Api link and click Get Started for free button under heading Bing Web Search API.
As Bing Web Search API is one of the services offered by Microsoft Cognitive Services, so you first need to sign up for a Microsoft Account (if not having already), by clicking Create One link.
User will have to go through an email verification before logging into his Microsoft account. On login, user will get the first page as shown in fig.
The page contains the essential keys (marked red), which need to later used to make api calls, so just keep those safe.
Before using the api, user is advised to get help from API Documentation and the API Reference. Particularly API Reference will help you to a great deal in understanding the URL parameters to be passed in api call.
To test the api with your access keys, you can run an api test on API Testing Console.
You need to input your key1 or key2 in Ocp-Apim-Subscription-Key above.
Here is the Complete Code to Integrate the Bing Web Search Api
Congratulations, you are now done with the api integration and can use the web search functionality. Thanks