Amazon API: Product Category

Posted on 2008-11-18
Medium Priority
Last Modified: 2012-05-05
The following script works well for retrieving information about books from the Amazon API.

However it does NOT work for other Amazon items such as electronics, movies, or toys.

Could someone please help me find a way to make it work with other categories?
Question by:hankknight
1 Comment

Accepted Solution

James Looney earned 2000 total points
ID: 22987274
You want to change the values (or create a form to put in your own values) that get set in lines 297 - 307. Also change the values in the Adefault array in lines 215 - 226.

See "Search Index" below, I changed to Music and it now pulls CDs that have to do with "Machiavelli"

//form the URL to send to Amazon as a search request
      'Service'       .'='.'AWSECommerceService'   .'&'.  //this makes it version 4
      'SubscriptionId'.'='.$subscriptionid         .'&'.  //is this correct?
      'Operation'     .'='.'ItemSearch'            .'&'.  //20080530: please note that $searchtype is not used here anymore!
//    'Operation'     .'='.$searchtype             .'&'.
      'Keywords'      .'='.urlencode($search)      .'&'.
      'SearchIndex'   .'='.'Music'                 .'&'.  //or Restaurants
      'ItemPage'      .'='.$page                   .'&'.
      'AssociateTag'  .'='.$Aassociates_id[$locale].'&'.
      'ResponseGroup' .'='.'Medium'                ;      //or Large

Open in new window


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question