PHPackages                             jakiboy/apaapi - 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. jakiboy/apaapi

ActiveLibrary[API Development](/categories/api)

jakiboy/apaapi
==============

Easily integrate with the Amazon Affiliate Program using the lightweight APAAPI library for Amazon Creators API (With OAuth 2.0 &amp; Credential-less)

2.0.4(2mo ago)543.8k—0%11MITPHPPHP &gt;=8.2CI failing

Since Oct 1Pushed 2mo ago4 watchersCompare

[ Source](https://github.com/Jakiboy/apaapi)[ Packagist](https://packagist.org/packages/jakiboy/apaapi)[ Docs](https://jakiboy.github.io/apaapi/)[ Fund](https://paypal.me/JIHADSINNAOUR)[ Patreon](https://www.patreon.com/jakiboy)[ RSS](/packages/jakiboy-apaapi/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)DependenciesVersions (35)Used By (0)

APAAPI
======

[](#apaapi)

[![Amazon Creators API PHP](assets/banner.png)](#)

\-- Amazon Affiliate With PHP --

Apaapi is an unofficial PHP library for accessing the Amazon Creators API, without relying on the **Amazon SDK**. It is lightweight (~300 KB) and simplifies interaction with the [Amazon Creators API](https://affiliate-program.amazon.com/creatorsapi/docs/), making it easier to integrate Amazon product data into PHP applications.

Caution

Apaapi 2.x exclusively uses the Amazon Creators API.
Support for Apaapi 1.x (PA-API v5) has been discontinued!

💡 Features
----------

[](#-features)

- **Request Builder** (Easier way to fetch API data).
- **OAuth 2.0**: Implements OAuth 2.0 authentication.
- **Credential-less** (No credentials required using product scraper).
- **Dual HTTP Support** (Auto-detects cURL or Stream fallback for maximum compatibility).
- **Search Filters** (Using builder).
- **Geotargeting** (Automatically redirect links based on the visitor's region).
- **Cart Generator** (Add to cart URL).
- **Rating** (Customer reviews).
- **Response Normalizer** (Normalize response data structure).
- **Response Error Handling** (Including semantic errors with HTTP status code 200).
- **Keyword Converter** (ASIN, ISBN, EAN, Node, Root).
- **Caching System** (Basic built-in cache to reduce API calls).
- **Zero dependencies** (Standalone – No external dependencies required).

[![Amazon Creators API PHP](assets/evaluate.png)](#)

⚡ Installing
------------

[](#-installing)

#### Using Composer:

[](#using-composer)

```
composer require jakiboy/apaapi

```

#### Without Composer:

[](#without-composer)

- **1** - [Download repository ZIP](https://github.com/Jakiboy/apaapi/archive/refs/heads/main.zip) (*Latest version*).
- **2** - Extract ZIP (*apaapi-main*).
- **3** - Include this lines beelow (*apaapi self-autoloader*).

```
include('apaapi-main/src/Autoloader.php');
\Apaapi\Autoloader::init();

```

- **4** - Use the [Quickstart examples](#quickstart).

⚡ Requirements
--------------

[](#-requirements)

- **PHP ^8.2**
- **cURL | Stream (file)**

⚡ Getting Started
-----------------

[](#-getting-started)

### Variables:

[](#variables)

- "*CREDENTIAL\_ID*" : From your Amazon Creators API (*your locale*), [More](https://affiliate-program.amazon.com/help/node/topic/GTPNVFFUV2GQ8AZV).
- "*CREDENTIAL\_SECRET*" : From your Amazon Creators API (*your locale*), [More](https://affiliate-program.amazon.com/help/node/topic/GTPNVFFUV2GQ8AZV).
- "\_TAG\_" : From your Amazon Associates (*your locale*), [More](https://affiliate-program.amazon.com/creatorsapi/docs/en-us/troubleshooting/sign-up-as-an-associate.html).
- "\_LOCALE\_" : **TLD** of the target marketplace to which you are sending requests (*com/fr/co.jp*), [Get TLD](https://affiliate-program.amazon.com/creatorsapi/docs/en-us/common-request-parameters.html#host-and-region).
- "\_KEYWORDS\_" : What you are looking for (*Products*), [More](https://affiliate-program.amazon.com/creatorsapi/docs/en-us/search-items.html).
- "\_ASIN\_" : Accepts (ISBN), Amazon Standard Identification Number (*your locale*), [More](https://affiliate-program.amazon.com/creatorsapi/docs/en-us/get-items.html#ItemLookup-rp).
- "\_NODE\_" : Browse Node ID (*your locale*), [More](https://affiliate-program.amazon.com/creatorsapi/docs/en-us/use-cases/organization-of-items-on-amazon/browse-nodes/browse-node-properties.html#browse-node-ids).

### Quickstart

[](#quickstart)

**Recommended** using *Apaapi Builder* or *Apaapi Product* (Scraped data) if you dont have API credentials.

[![Product](assets/product.png)](#Quickstart)

#### Builder:

[](#builder)

```
/**
 * @see Use Composer,
 * Or include Apaapi Autoloader Here.
 */

use Apaapi\includes\Builder;

// (1) Init request builder
$builder = new Builder('_CREDENTIAL_ID_', '_CREDENTIAL_SECRET_', '_TAG_', '_LOCALE_');

// (2) Get response (Search)
$data = $builder->searchOne('Sony Xperia 1 VI'); // Normalized array
```

Note

*See full builder usage at [/wiki/Builder](https://github.com/Jakiboy/apaapi/wiki/Builder)* and use case *[/examples](https://github.com/Jakiboy/apaapi/tree/main/examples)*

#### Product:

[](#product)

```
/**
 * @see Use Composer,
 * Or include Apaapi Autoloader Here.
 */

use Apaapi\includes\Product;

// (1) Init product
$product = new Product('B00NLZUM36', 'com', 'test-21');

// (2) Get response
$data = $product->get(); // Array
```

Note

*See full product usage at [/wiki/Product](https://github.com/Jakiboy/apaapi/wiki/Product)*

### Rating:

[](#rating)

Get customer reviews of product as average rating and count (Scraped data).

[![Rating](assets/rating.png)](#Rating)

```
use Apaapi\includes\Rating;

// Init Rating
$rating = new Rating('B00NLZUM36', 'com', 'test-21');

// Get Response
$data = $rating->get(); // Array
```

### Cart:

[](#cart)

Get affiliate cart URL.

[![Cart](assets/cart.png)](#Cart)

```
use Apaapi\lib\Cart;

// Init Cart
$cart = new Cart();
$cart->setLocale('com')->setPartnerTag('test-21');

// Get Response
$data = $cart->set(['B00NLZUM36' => 3]); // String
```

⚡ Advanced
----------

[](#-advanced)

### Basic (Search):

[](#basic-search)

Extensible search method.

```
use Apaapi\operations\SearchItems;
use Apaapi\lib\Request;
use Apaapi\lib\Response;

// (1) Set operation
$operation = new SearchItems();
$operation->setPartnerTag('_TAG_')->setKeywords('_KEYWORDS_');

// (2) Prapere request
$request = new Request('_CREDENTIAL_ID_', '_CREDENTIAL_SECRET_');
$request->setLocale('_LOCALE_')->setPayload($operation);

// (3) Get response
$response = new Response($request);
$data = $response->get(); // Array
```

Note

*See all available TLDs used by setLocale() at [/wiki/TLDs](https://github.com/Jakiboy/apaapi/wiki/TLDs)*

### Basic (Get):

[](#basic-get)

Extensible get method.

```
use Apaapi\operations\GetItems;
use Apaapi\lib\Request;
use Apaapi\lib\Response;

// Set operation
$operation = new GetItems();
$operation->setPartnerTag('_TAG_')->setItemIds(['_ASIN_']);

// Prapere request
$request = new Request('_CREDENTIAL_ID_', '_CREDENTIAL_SECRET_');
$request->setLocale('_LOCALE_')->setPayload($operation);

// Get response
$response = new Response($request);
$data = $response->get(); // Array
```

### Operations:

[](#operations)

All available operations.

```
use Apaapi\operations\GetItems;
use Apaapi\operations\SearchItems;
use Apaapi\operations\GetVariations;
use Apaapi\operations\GetBrowseNodes;

// (1) GetItems
$operation = new GetItems();
$operation->setPartnerTag('_TAG_');
$operation->setItemIds(['_ASIN_']); // Array

// (2) SearchItems
$operation = new SearchItems();
$operation->setPartnerTag('_TAG_');
$operation->setKeywords('_KEYWORDS_'); // String

// (3) GetVariations
$operation = new GetVariations();
$operation->setPartnerTag('_TAG_');
$operation->setASIN('_ASIN_'); // String

// (4) GetBrowseNodes
$operation = new GetBrowseNodes();
$operation->setPartnerTag('_TAG_');
$operation->setBrowseNodeIds(['_NODE_']); // Array
```

### Resources:

[](#resources)

Optimize response time by setting only the needed resources.

```
use Apaapi\operations\SearchItems;

// Set Operation
$operation = new SearchItems();
$operation->setPartnerTag('_TAG_')->setKeywords('_KEYWORDS_');

// Set Resources (3)
$operation->setResources(['images.primary.small', 'itemInfo.title', 'offersV2.listings.price']);
```

Note

*See all available resources used by setResources() at [/wiki/Resources](https://github.com/Jakiboy/apaapi/wiki/Resources)*

Authors
-------

[](#authors)

- [Jakiboy](https://github.com/Jakiboy) (*Initial work*)
- [Contributors](https://github.com/Jakiboy/apaapi/graphs/contributors)
- [Any PR is welcome!](./CODE-OF-CONDUCT.md)

### ⭐ Support:

[](#-support)

Skip the coffee! If you like the project, a **Star** would mean a lot.

Important

*The **Amazon logo** included in top of this page refers only to the [Amazon Creators API](https://affiliate-program.amazon.com/creatorsapi/docs/)*, Amazon Inc. or its affiliates.

###  Health Score

60

—

FairBetter than 99% of packages

Maintenance88

Actively maintained with recent releases

Popularity37

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 95.8% 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.

###  Release Activity

Cadence

Every ~73 days

Recently: every ~56 days

Total

33

Last Release

60d ago

Major Versions

1.5.1 → 2.0.02026-01-16

PHP version history (3 changes)1.0.0PHP &gt;=5.6

1.2.0PHP &gt;=7.4

1.3.3PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/7a9408e68876cf40312866dc080b26fda86fdd82efd2d82a09612077cb73af3c?d=identicon)[Jakiboy](/maintainers/Jakiboy)

---

Top Contributors

[![Jakiboy](https://avatars.githubusercontent.com/u/7604550?v=4)](https://github.com/Jakiboy "Jakiboy (205 commits)")[![Claudio-Emmolo](https://avatars.githubusercontent.com/u/113107618?v=4)](https://github.com/Claudio-Emmolo "Claudio-Emmolo (6 commits)")[![gnadelwartz](https://avatars.githubusercontent.com/u/4593242?v=4)](https://github.com/gnadelwartz "gnadelwartz (3 commits)")

---

Tags

amazonamazon-affiliates-programamazon-product-advertisingamazon-product-advertising-apiphpphpapiamazonproductapaapiamazon-affiliate-programcreators-api

### Embed Badge

![Health badge](/badges/jakiboy-apaapi/health.svg)

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

###  Alternatives

[cpigroup/php-amazon-mws

An open-source library to connect to Amazon's MWS web services in an object-oriented manner, with a focus on intuitive usage.

255122.3k2](/packages/cpigroup-php-amazon-mws)[marcl/amazonproductapi

PHP library to perform product lookup and searches using the Amazon Product API.

13212.4k1](/packages/marcl-amazonproductapi)[sonnenglas/laravel-amazon-mws

Use Amazon's MWS web services with Laravel ^7.x. Based on creacoon/amazon-mws-laravel package and modified to make it compatible with latest Laravel releases (+ bugfixes).

644.5k](/packages/sonnenglas-laravel-amazon-mws)

PHPackages © 2026

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