Sunday, 15 September 2013

Bing Search API C# Sample Code not working

Bing Search API C# Sample Code not working

Has anyone got the Bing API C# Sample code working? I am referring the Web
Examples on this page:
https://skydrive.live.com/view.aspx?resid=9C9479871FBFA822!112&app=Word&authkey=!ANNnJQREB0kDC04
I'm also using the BingSearchContainer.cs file string rootUri =
"https://api.datamarket.azure.com/Bing/Search";
var bingContainer = new Bing.BingSearchContainer(new Uri(rootUri));
var accountKey = "Zasjkdhfkajshdfkjhasdkfjhetc";
bingContainer.Credentials = new NetworkCredential(accountKey, accountKey);
// Build the query:
// Example says "var webQuery = .... I just tried this
DataServiceQuery<WebResult> webQuery = bingContainer.Web("Testing", null,
null, null, null, null, null, null);
// This returns a 403
// Example says "var results = .... I just tried this too...
IEnumerable<WebResult> results = webQuery.Execute();
I also tried things like:
bingContainer.IgnoreMissingProperties = true;
... but that made no difference...
Thank you.

No comments:

Post a Comment