Reputation: 527
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.
Upvotes: 2
Views: 1835
Reputation: 671
have you subscribed for using the bing api ? please check the following link and subscribe as per your requirement
https://datamarket.azure.com/dataset/5BA839F1-12CE-4CCE-BF57-A49D98D29A44
Upvotes: 1