azure-cognitive-servicesbing-apibing-search

Bing Web Search shows results only for my domain


Using Bing Web Search API, I need to filter results only for my domain, example query:

https://api.cognitive.microsoft.com/bing/v7.0/search?q=site:mysite.com+myquery

But in results I received not only mysite.com results but also from sites like wikipedia and others. How I can search result only for my domain? Bing Custom Search not work for me because I have more than 10k transactions


Solution

  • Your website is probably not known or indexed by Bing. Since you use Bing Search API, not a custom indexing service or search across a sitemap. The actual Bing website will need to be able to find your site. Since it doesn't, this triggers the default behavior of returning as relevant as possible results.

    This behavior is valid for urls such as the following:

    https://api.cognitive.microsoft.com/bing/v7.0/search?q=microsoft+site:notAnIndexedWebsite.com

    Formatting wise, there is multiple options, as seen here. None of it is a problem in this case.