# Problem in V3 search in yahoo shopping

**URL:** <https://www.ruby-forum.com/t/problem-in-v3-search-in-yahoo-shopping/196471>\
**Category:** Ruby-Forum\
**Created:** [September 21, 2007, 11:36am UTC](https://www.ruby-forum.com/t/problem-in-v3-search-in-yahoo-shopping/196471 "2007-09-21T11:36:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![asitk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f17d59/32.png) [@asitk](https://www.ruby-forum.com/u/asitk)\
**Post date:** [September 21, 2007, 11:36am UTC](https://www.ruby-forum.com/t/problem-in-v3-search-in-yahoo-shopping/196471/1 "2007-09-21T11:36:08Z")

</div>

Hi all,

I am trying to implement the yahoo shopping apis in my application. I am  
trying to get the response using the XMLSimple. I am getting proper  
result for the V1 and V2 product search. But V3 product search is not  
working at all. Every time it give the error of “Invalid User Agent”. My  
code snippet is:

url =  
URI.parse(‘[http://api.shopping.yahoo.com/ShoppingService/V3/productSearch](http://api.shopping.yahoo.com/ShoppingService/V3/productSearch)’)  
appid = ‘xxxxxxxxxx’  
post\_args =  
{  
‘appid’ =\> appid,  
‘department’ =\> sindex,  
‘query’ =\> ipod,  
‘start’ =\> 1,  
‘results’ =\>25,  
}  
xml\_data = Net::HTTP.post\_form(url,post\_args).body  
data = XmlSimple.xml\_in(xml\_data)  
return data

and the error message I am getting is:

#Net::HTTPOK:0x48be634

\<?xml version="1.0" encoding="utf-8"?\>

The following errors were detected:  
User-agent not valid

I also tried with appending the user agent string in the request url  
like this:

‘User-Agent’ =\> ‘Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;  
rv:1.8.0.1) Gecko/20060111 Firefox/1.5.0.1’

But It didn’t work. Please help me sorting out this issue. It is  
blocking the flow of the application.

Thanks in advance.  
asitk
