Forum: Problem in V3 search in yahoo shopping

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
6f7276dcbd18b154d8aabbcb0d9bfa35?d=identicon&s=25 Asit K. (asitk)
on 2007-09-21 11:36
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 =
    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:

<?xml version="1.0" encoding="utf-8"?>
<Error xmlns="urn:yahoo:api"
The following errors were detected:
<Message>User-agent not valid</Message>

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: Gecko/20060111 Firefox/'

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

Thanks in advance.
This topic is locked and can not be replied to.