Amazon API: Product Category

Posted on 2008-11-18
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
    LVL 6

    Accepted Solution

    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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
    To properly understand GitHub, let’s divide it into two words ‘Git’ and ‘Hub’. Git is basically a ‘Distribution Version Control’ (DVC) and ‘Source Code Management’ (SCM) system widely used by software programmers while Hub means the efficient centre…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
    This video is a brief demonstration on how to use security groups and Network Access Control Lists (ACLs) in Amazon Web Services.  Security groups and Network ACLs are mechanisms you can use in AWS to control network traffic.

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now