PHPackages                             edwinmugendi/amazon - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. edwinmugendi/amazon

ActiveLibrary[API Development](/categories/api)

edwinmugendi/amazon
===================

Amazon Product Advertising API

1182[2 issues](https://github.com/edwinmugendi/amazon-apai/issues)PHP

Since Sep 25Pushed 9y ago2 watchersCompare

[ Source](https://github.com/edwinmugendi/amazon-apai)[ Packagist](https://packagist.org/packages/edwinmugendi/amazon)[ RSS](/packages/edwinmugendi-amazon/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Amazon Product Advertising API wrapper
======================================

[](#amazon-product-advertising-api-wrapper)

This library wraps the following functions of [Amazon's Product Advertising API](http://docs.aws.amazon.com/AWSECommerceService/latest/DG/Welcome.html):

1. [ItemSearch](http://docs.aws.amazon.com/AWSECommerceService/latest/DG/ItemSearch.html)
2. [BrowseNodeLookup](http://docs.aws.amazon.com/AWSECommerceService/latest/DG/BrowseNodeLookup.html)
3. [ItemLookup](http://docs.aws.amazon.com/AWSECommerceService/latest/DG/ItemLookup.html)
4. [SimilarityLookup](http://docs.aws.amazon.com/AWSECommerceService/latest/DG/SimilarityLookup.html)
5. [CartAdd](http://docs.aws.amazon.com/AWSECommerceService/latest/DG/CartAdd.html)
6. [CartClear](http://docs.aws.amazon.com/AWSECommerceService/latest/DG/CartClear.html)
7. [CartCreate](http://docs.aws.amazon.com/AWSECommerceService/latest/DG/CartCreate.html)
8. [CartGet](http://docs.aws.amazon.com/AWSECommerceService/latest/DG/CartGet.html)
9. [CartModify](http://docs.aws.amazon.com/AWSECommerceService/latest/DG/CartModify.html)
Usage
-----

[](#usage)

1. Load and initialize Apai Class ```php require\_once \_\_DIR\_\_ . '/../vendor/autoload.php'; // Autoload files using Composer autoload use Edwinmugendi\\Amazon\\Apai;

$apai = new Apai();

```
2. Set the following 4 configs using the $apai->setConfig() function
```php
//Set configs
$apai->setConfig('ApiKey', 'XXXXX');
$apai->setConfig('ApiSecret', 'XXXX');
$apai->setConfig('AssociativeTag', 'XXXX');
$apai->setConfig('EndPoint', 'webservices.amazon.de');

```

3. If you are looping via a list of items, you might need to reset the parameters. This basically removes any preset parameters

```
//Reset parameters first. This is important if you are looping through items
$apai->resetParam();
```

4. Set the parameters using the `$apai->setParam()` function

```
//Set parameters
$apai->setParam('SearchIndex', 'All');
$apai->setParam('ResponseGroup', 'Offers');
$apai->setParam('Keywords', 'hp laptop');
```

5. Call the actual function eg ItemSearch

```
$verbose = true; //Print url sent to Amazon and the results from Amazon
$response = $apai->itemSearch($verbose);
```

6. Handle the response. The response is an array with `status` and `response` keys. If the request is successful, `status` will be `1` and `response` will have the xml string that you should parse with `SimpleXMLElement`, otherwise `status` will be `0` and `response` will have the error message.

```
if ($response['status']) {
    $item_lookup_xml = new \SimpleXMLElement($response['response']);
} else {
    echo $response['response'];
}//E# if else statement
```

For sample code of every function, check the `tests` folder.

Contact me on  if you need any assistance.

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/185ca9f9c4cbefb676702fdf0eae8dd2bdc2adc5f4fbdaa1327c44a2e24e5c2f?d=identicon)[edwinmugendi](/maintainers/edwinmugendi)

---

Top Contributors

[![sapamatech](https://avatars.githubusercontent.com/u/192622075?v=4)](https://github.com/sapamatech "sapamatech (18 commits)")

### Embed Badge

![Health badge](/badges/edwinmugendi-amazon/health.svg)

```
[![Health](https://phpackages.com/badges/edwinmugendi-amazon/health.svg)](https://phpackages.com/packages/edwinmugendi-amazon)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
