Question

How do we use the Bing API in C#? I have to pass a query to the Bing API and then get the results.

Was it helpful?

Solution

Download bing dlls from microsoft site and add those dlls . Then only we can able to use bing service.

OTHER TIPS

BingService.BingService service = new BingService.BingService();

        SearchRequest request = new SearchRequest();
        // use your Bing AppID
        request.AppId = ""; /* Your App ID */
        request.Query = "rose"; // your search query

        // I want to search only web
        request.Sources = new SourceType[]
        {
            SourceType.Image 
        };

        SearchResponse response = service.Search(request);

        foreach (ImageResult result in response.Image.Results)
        {

            //lstBxImages.Items.Add("<a href="+result.Url + '"'+"></a>" + result.Title);
            imgliteral.Controls.Add(new LiteralControl("<img src=" + result.MediaUrl + " width=100

Here's something will help you a lot https://github.com/insatmc/BingMapHelper

Just adding to above there is a full documentation of te API given by BING in a PDF.

Here is a Basic Details Version

hii..

Add a bing reference to web references in an application and use search.wsdl

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top