Cookies on

This web site uses some strictly nesessary cookies to make this web site work.

We would also like to set additional cookies to understand how you use, remember your settings and improve our services.


Re: Yahoo! Search Web Service C# Example

There was one small mistake in this when I originaly posted. This is now fixed, just download again to get the fixed code.

The adult_ok and similar_ok parameters take the values 0 and 1 not true and false. As a result I had to change the code to look like this:

adultOk ? "1" : "0", similarOk ? "1" : "0"

It is interesting to note that the C# String.Format has no easy way of doing this I would have liked to put the following in the format string:


Comment from Martin G. Brown at Thursday, 03 March 2005 09:16PM (GMT+00)

Re: Yahoo! Search Web Service API C# Example

Thanks, I use it for my portal, in complement of Google API. I just add code to support proxy.

Just after "public class YahooSearchService {" :

public WebProxy Proxy {
get { return _proxy; }
set { _proxy = value; }
protected WebProxy _proxy;

Then, after each "HttpWebRequest request = (HttpWebRequest)WebRequest.Create(requestUri);" :

if (_proxy != null) {
request.Proxy = _proxy;

Comment from Michel at Monday, 21 March 2005 03:47PM (GMT+00)

Re: Yahoo! Search Web Service API C# Example

I found a small mistake in the Yahoo.API.NewsSearchResponse. A "&" is missing in the requestUri just before the result parameter. The result number is then always 10 no matter wich paramteter is passed to the function.

Anyway you have done a very useful job. Thank u.

Comment from FG at Monday, 25 April 2005 04:48PM (GMT+00)

Re: Yahoo! Search Web Service API C# Example

Great stuff. As an FYI, there is now als an API to use for TermExtraction:

Due to your excellent examples, this was very simple to add!

If you need some inspiration as to what is possible with this API, the peopel that build used it

Comment from René at Friday, 17 June 2005 08:28AM (GMT+00)

Re: Yahoo! Search Web Service API C# Example

Great to see someone built an example in C#/VB.NET - should definitely be posted on Yahoo! somewhere!!! Wouldn't have had to spend an hour looking around for it ;)

Comment from John at Saturday, 24 September 2005 05:02PM (GMT+00)

How to create the response cs files from XSD


I liked the examples, it is the only one example to demonstrate how to create REST requests and comprehend corresponding responses in I have one clarification, how did you create the .cs files from XSD files.

I have not found out how to use the XSD tool to accomplish the job !!

Comment from Sanjit Rath at Tuesday, 07 March 2006 10:26PM (GMT+00)

Re: Yahoo! Search Web Service API C# Example


I have downloaded this API and trying to run it I always get this error in Visual IDE.

"WebException was handled, Unable to connect to remote server."

I have got the appID and using that ID in the code. Could you please let me know what am I doing wrong.



Comment from Lipi at Friday, 19 January 2007 04:00PM (GMT+00)

Re: Yahoo! Search Web Service API C# Example


This normally just indicates that the application can not make an internet connection with Yahoo's servers.

This can be caused by a number of things including fire wall settings, network outages and DNS outages.

The best way to confirm if this is infact the cause is to open up internet explorer and enter the web address of the service you wish to use in the address bar. This should confirm if the issue is with your application or your internet connection.

One exception to this is if you are using a software firewall. These can often give different connection privilages depending upon the exe being run.

Let us know if this helps.


Comment from Martin at Monday, 22 January 2007 05:30PM (GMT+00)

Sorry, this post is no longer accepting comments.