2017 © Pedro Peláez
 

library amazon

Amazon API Package

image

flo5581/amazon

Amazon API Package

  • Thursday, May 19, 2016
  • by flo5581
  • Repository
  • 1 Watchers
  • 0 Stars
  • 26 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Amazon Api Helper

Installation

Add this package to your composer.json or execute
composer require flostone/amazon
Include the Amazon Class using
use FloStone\Amazon\Amazon;
and
use FloStone\Amazon\AmazonCountry;
for the available countries., (*1)

Usage

Amazon Credentials

All you need is an Amazon Access Key (public and secret) and an Associate Tag.
You can get your Access Key here
For the Associate Tag you must create an Associate Account here
, (*2)

Using the Code

Create a new Amazon instance using
$amazon = new Amazon($accesskey, $associatetag, $secretkey, $locale);
The locale can be any of the supported Amazon Locales.
You can use strings or the pre-defined constants found in AmazonCountry.php.
Constants:
AmazonCountry::US // USA
AmazonCountry::DE // Germany
AmazonCountry::FR // France
AmazonCountry::UK // United Kingdom
AmazonCountry::IT // Italy
AmazonCountry::ES // Spain
AmazonCountry::BR // Brasil
AmazonCountry::CA // Canada
AmazonCountry::CN // China
AmazonCountry::IN // India
AmazonCountry::JP // Japan
AmazonCountry::MX // Mexico
After initializing the Instance, you can now add Parameters using the "param" function:
$amazon->param('Operation', 'ItemSearch');
These parameters will be in the request url.
After adding all your parameters, simply use the "request" function to send the request:
$response = $amazon->request()
By default the response will be a Page of the Amazon API parsed through the SimpleXMLElement class.
However, if you wish to get all Pages in a returned collection, simply add
$amazon->allPages = true
to the instance and it will return a collection of 10 Pages.
, (*3)

The Versions

19/05 2016

dev-master

9999999-dev

Amazon API Package

  Sources   Download

The Requires

 

by Flo Stone

19/05 2016

1.0.2

1.0.2.0

Amazon API Package

  Sources   Download

The Requires

 

by Flo Stone

18/05 2016

1.0.1

1.0.1.0

Amazon API Package

  Sources   Download

The Requires

 

by Flo Stone