Amazon API: Product Category

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?
LVL 16
Who is Participating?
James LooneyConnect With a Mentor Sr. Programmer/AnalystCommented:
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

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.