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"

4 comments
-
Anonymous commented
need easy logon with out all the ****
-
Ronak commented
With Bing custom search API, you can precisely do this. Specify domains/webpages and create your own search engine. More info at customsearch.ai.
-
Dev HT commented
The site directive should work for your case, you might have to add AND, OR and NOT depending on how you want to interconnect the sites you are using.
Example: "heart disease" (site:bbc.co.uk OR site:cnn.com AND NOT site:live.cnn.com)
-
Anonymous commented
have you tried the minus - symbol to remove unwanted results?