Bing web search API to search only specific sites
I'm using Bing web search API for getting articles about health in my Bot. How can I specify in the API which sites(urls) to search? Because sometimes it searches irrelevant sites, like wiki or wikipedia which I don't want to use. I've tried with site: parameter in API but it only gets the first site and ignores the rest urls. Here is the API which I use now: https://api.cognitive.microsoft.com/bing/v5.0/search?q=site:cdc.gov/ NOT site:wikipedia.org/" +url+ "&count=10&offset=0&mkt=en-us&safesearch=Moderate"
https://social.msdn.microsoft.com/Forums/azure/en-US/6aa2fa51-144e-4111-9e41-27142484e7ab/can-urls-be-whitelisted-when-using-bing-search-api?forum=DataMarket looks like it uses extra parentheses around the argument of the NOT operator - you might consider posting to that forum with further questions.
@msBot1111 Did the answer from @willportnoy work for you?
no :/, maybe that worked before, but now it doesn't work anymore
@msBot1111 Did you modify your code based on the answer from @willportnoy above?
@carlosscastro yes I've tried with that but it's not working for me
@msBot1111 As this is a problem on talking to Bing web search api, you'd get the best help from them. I can pass your issue to them, or you can do that yourself directly by posting your question here: https://cognitive.uservoice.com/
I know I am late to the party but this is what worked for me. From the docs I got the template and my final url string was this "https://api.cognitive.microsoft.com/bing/v7.0/news/search?q=heart+disease+%28site%3Abbc.co.uk+OR+site%3Acnn.com%29&mkt=en-US"