Over the next few weeks, we will be exploring the capabilities of Microsoft’s Cognitive Services. These application programming interface (API) sets empower users with intelligent algorithms that see, hear, speak, understand, and interpret data when applied to apps, websites, and bots.

Cognitive Services Showcase: Search

For our first exploration of Microsoft’s Cognitive Services APIs, we will be looking into the Search category. Adding the Bing Search API to your apps will give you the ability to comb through billions of web pages, images, videos, and news with a single API call. I’ll also show how easy it is to create your own search engine using the Custom Search API.

All About Search

When we need to search for something on the web such as a new recipe for chocolate cake or maybe some helpful articles related to some research we’re doing, we probably use a search engine like Google or Bing to help us navigate to the content for which we’re looking. However, given the billions of pages online, and the fact that a small percentage of popular pages typically  overshadow the rest of the web, it may be desirable to better control the results a search engine returns. This is where the Search APIs can come in handy. Using a Cognitive Services Search API will allow you to define a slice of the web from which to return results.

As of today, Microsoft has seven search APIs. These APIs can handle many tasks – from searching for images and video, to browsing the news, to intelligently autosuggesting options for searches.

search-autosuggest Bing Autosuggest API Give your app intelligent autosuggest options for searches
search-entitysearch Bing Entity Search API Enrich your experiences by identifying and augmenting entity information from the web
search-videosearch Bing Video Search API Search for videos and get comprehensive results
search-newssearch Bing News Search API Search for news and get comprehensive results
search-customsearch Bing Custom Search API An easy-to-use, ad-free, commercial-grade search tool that lets you deliver the results you want
search-websearch Bing Web Search API Get enhanced search details from billions of web documents
search-imagesearch Bing Image Search API Search for images and get comprehensive results

To try any of these Search Cognitive Services for yourself, get a free trial API key here.

Bing Custom Search API


One of the most useful Search APIs, in my opinion, is the Bing Custom Search. This API allows you to quickly and reliably define the slices of the web from which you want results. This API is very flexible and easy to use. Simply change the parameters of the sites you want and don’t want and explore site suggestions to intelligently expand the scope of your search domain.

Here at BlueGranite, we have a very active blog written by many of our esteemed consultants. Did you know that many of us have personal blogs, too?

To demo this API, I have created my own custom search engine to pull search results from everyone’s personal blogs as well as the main BlueGranite blog.

To begin, navigate to customsearch.ai and click Get Started. On the next page, you’ll need to sign in with your Microsoft/Office 365 credentials.

Bing Custom Search

Next, you will need to agree to the terms and conditions and click Agree.

Bing Custom Search

There are only a couple of steps that you’ll need to go through to create your customized search. Click Create new instance and give your new custom search a name.

Custom Search InstancesCreate New Custom Search

Next, you’ll begin typing in the URLs for the sites you want to search. For my custom search instance, I am including all the URLs for each BlueGranite employee’s personal site. Note that you can adjust the rankings of each active site and even block particular sites from which you don’t want search results.

Search Configuration

On the next few tabs, the site will give you the API endpoint information if you need to embed these results in your own app. The site also generates code to easily embed the custom search into your own web page.

Try my custom search for yourself:

(Hint – try searching for “Power BI” or “SSAS”)

Notice that the search engine returns relevant posts from the BlueGranite blog as well as everyone’s personal blogs. Imagine using this for a specific set of sites where domain-specific and highly specialized results are needed. For example, you could create a custom search engine of your competitors’ sites or maybe a custom search engine that looks for results related to a specific product.

That’s it! Easy, huh? In just a few clicks, I have created a custom search engine using the Microsoft Cognitive Services Bing Custom Search API.

Many of these APIs work in a similar way. They are all designed to be easily consumable and flexible for your individual use cases. Check out all of the Cognitive Services here.

More to Come

In the coming weeks, we will be showcasing the remaining four Cognitive Services categories: Vision, Speech, Knowledge, and Language. Be sure to subscribe to our blog so that you don’t miss seeing the rest of these amazingly powerful Cognitive Services APIs!