Important facts about commercial licenses

  • Licenses are perpetual. They do not expire and do not need to be renewed.
  • Licenses can be upgraded. You can upgrade to a more expensive license later paying only the difference in cost.
  • Pay attention to the distribution type - Hosted (sites / servers), binary (applications) or source (includes all the others). Choose according to your needs (more below).
  • All licenses allow commercial use unless otherwise indicated.
  • Read the full license by clicking on the icon.
  • Read more about licenses in our handy license guide.
Free

BSD license

The BSD license is an
open-source license.
You need to log-in or create an account
  • Create an account
  • Log-in
  • Please use your real name.
  • Account activation link will be sent to this address.
  • Minimum 8 characters

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

  • Released: Mar 28, 2012
    Last Update: Mar 26, 2012
  • Language: PHP
  • Category: Ecommerce
(2 ratings)

Amazon Product Advertising API PHP Wrapper

Amazon Product Advertising API PHP Wrapper
Developed by Hiraq, Released Mar 28, 2012

PHP library class for amazon product advertising API.

PHP

Tags: amazon api , amazon product advertising api , php

A PHP library class to working with Amazon Product Advertising API, for working with the latest version of Amazon Product Advertising API (2011-08-01).

Requirements :

  • PHP 5.3 (min!)
  • SimpleXMLElement must exist (PHP must be compiled with libxml. It is the default on most configurations)

Features :

  • Search Operation
  • ItemLookup Operation
Back to top

About

I have created this library to helping people working with Amazon Product Advertising API. Using PHP 5.3 version and latest PHP features such as namespace and lambda function, and also latest Amazon Product Advertising API.

For now, this library only supports two main operations :

  1. Search operation
  2. ItemLookup operation
Back to top

Installation

Installation

Copy the library into your working folder, and set library folder into your php include_path settings.

Examples :

  • Working folder : /var/www/amazon/
  • Library copied into /var/www/amazon/php-amazon-pa-wrapper/
  • In your PHP project, use set_include_path to add the library foldor to the include path: set_include_path(get_include_path() . PATH_SEPARATOR.YOUR_ROOT.YOUR_DS . 'php-amazon-pa-wrapper')
  • Call the main class at Amazon.php and setup autoload (to load all the dependencies)

complete code : https://gist.github.com/2177610

Back to top

How To Use

How To Use

This library only support two common amazon product advertising API process :

  • Search
  • ItemLookup

Search request code example :

<?php
/*
 * set operations
 */
 $amazon->request()->search('php');
 $amazon->request()->setParams(array(  
     'SearchIndex' => 'Books',          
     'ResponseGroup' => 'Large'
 ));

 //get response data from sended request
 $amazon->response()->proceed($amazon->request()->send());

 //debug function is my custom function to 'print_r' any variables, you can use your own function.
 //getItems will return all items data from amazon response
 debug($amazon->response()->getItems());

To use Search operation, please do not forget to include 'SearchIndex' when you use setParams.

ItemLookup example:

<?php

/*
 * set operations
 */
 $amazon->request()->detail('0596157134');
 $amazon->request()->setParams(array(            
      'ResponseGroup' => 'Large'
  ));

  $amazon->response()->proceed($amazon->request()->send());
  debug($amazon->response()->getItems());

Response data :

  • to get total results : use method getTotalResults (from Response class)
  • to get total pages : use method getTotalPages (from Response class)
  • to get raw xml data from amazon response : use method getRawXml (from Response class)
  • For any response data you can check in my Response class.
View all 2 reviews »

User Reviews

  • mark hayhurst 4 months ago
    Seems to work really well and is easy to use (esp after finding that Amazon's own PHP APIs seem to all be dead!)
    Flag
    Was this helpful? Yes No
  • ajay singh 11 months ago
    g8 component,
    Flag
    Was this helpful? Yes No
Read all 2 comments »

Questions & Comments


Or enter your name and Email
  • Mark Petherbridge 10 months ago
    Does this incorporate the Amazon Associates referral code for the user?
You must be logged-in to vote. Log-in to your account or register now.