{"id":28899394,"url":"https://github.com/jakiboy/apaapi","last_synced_at":"2026-04-01T19:27:04.006Z","repository":{"id":54410205,"uuid":"211958446","full_name":"Jakiboy/apaapi","owner":"Jakiboy","description":"⚡ Easily integrate with the Amazon Affiliate Program using the lightweight APAAPI library for Amazon Product Advertising API v5 (With Credential-less).","archived":false,"fork":false,"pushed_at":"2025-01-29T16:20:16.000Z","size":426,"stargazers_count":44,"open_issues_count":0,"forks_count":8,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-06-21T08:09:27.399Z","etag":null,"topics":["amazon","amazon-affiliates-program","amazon-product-advertising","amazon-product-advertising-api","php"],"latest_commit_sha":null,"homepage":"https://jakiboy.github.io/apaapi/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jakiboy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"jakiboy","custom":"https://paypal.me/JIHADSINNAOUR"}},"created_at":"2019-09-30T21:13:03.000Z","updated_at":"2025-01-29T16:19:28.000Z","dependencies_parsed_at":"2024-04-24T06:40:33.388Z","dependency_job_id":"38f81458-bcb6-492a-90bc-abdb4aeb23df","html_url":"https://github.com/Jakiboy/apaapi","commit_stats":{"total_commits":58,"total_committers":4,"mean_commits":14.5,"dds":"0.12068965517241381","last_synced_commit":"17097490475dfc4f5936469b4e2ba7b71c88eb10"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/Jakiboy/apaapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jakiboy%2Fapaapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jakiboy%2Fapaapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jakiboy%2Fapaapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jakiboy%2Fapaapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jakiboy","download_url":"https://codeload.github.com/Jakiboy/apaapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jakiboy%2Fapaapi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261088358,"owners_count":23107684,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon","amazon-affiliates-program","amazon-product-advertising","amazon-product-advertising-api","php"],"created_at":"2025-06-21T08:09:27.127Z","updated_at":"2026-01-26T13:18:38.499Z","avatar_url":"https://github.com/Jakiboy.png","language":"PHP","funding_links":["https://patreon.com/jakiboy","https://paypal.me/JIHADSINNAOUR"],"categories":[],"sub_categories":[],"readme":"# APAAPI\n\n[![Amazon Creators API PHP](assets/banner.png)](#)\n\n-- Amazon Affiliate With PHP --\n\nApaapi 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.\n\n\u003e [!CAUTION]\n\u003e Apaapi 2.x exclusively uses the Amazon Creators API.  \n\u003e Support for Apaapi 1.x (PA-API v5) has been discontinued!\n\n## 💡 Features\n\n* **Request Builder** (Easier way to fetch API data).\n* **OAuth 2.0**: Implements OAuth 2.0 authentication.\n* **Credential-less** (No credentials required using product scraper).\n* **Dual HTTP Support** (Auto-detects cURL or Stream fallback for maximum compatibility).\n* **Search Filters** (Using builder).\n* **Geotargeting** (Automatically redirect links based on the visitor's region).\n* **Cart Generator** (Add to cart URL).\n* **Rating** (Customer reviews).\n* **Response Normalizer** (Normalize response data structure).\n* **Response Error Handling** (Including semantic errors with HTTP status code 200).\n* **Keyword Converter** (ASIN, ISBN, EAN, Node, Root).\n* **Caching System** (Basic built-in cache to reduce API calls).\n* **Zero dependencies** (Standalone – No external dependencies required).\n\n[![Amazon Creators API PHP](assets/evaluate.png)](#)\n\n## ⚡ Installing\n\n#### Using Composer:\n\n```\ncomposer require jakiboy/apaapi\n```\n\n#### Without Composer:\n\n* **1** - [Download repository ZIP](https://github.com/Jakiboy/apaapi/archive/refs/heads/main.zip) (*Latest version*).\n* **2** - Extract ZIP (*apaapi-main*).\n* **3** - Include this lines beelow (*apaapi self-autoloader*).\n\n```\ninclude('apaapi-main/src/Autoloader.php');\n\\Apaapi\\Autoloader::init();\n```\n\n* **4** - Use the [Quickstart examples](#quickstart).\n\n## ⚡ Requirements\n\n* **PHP ^8.2**\n* **cURL | Stream (file)**\n\n## ⚡ Getting Started\n\n### Variables:\n\n* \"_CREDENTIAL_ID_\" : From your Amazon Creators API (*your locale*), [More](https://affiliate-program.amazon.com/help/node/topic/GTPNVFFUV2GQ8AZV). \n* \"_CREDENTIAL_SECRET_\" : From your Amazon Creators API (*your locale*), [More](https://affiliate-program.amazon.com/help/node/topic/GTPNVFFUV2GQ8AZV). \n\n* \"\\_TAG\\_\" : From your Amazon Associates (*your locale*), [More](https://affiliate-program.amazon.com/creatorsapi/docs/en-us/troubleshooting/sign-up-as-an-associate.html). \n* \"\\_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). \n* \"\\_KEYWORDS\\_\" : What you are looking for (*Products*), [More](https://affiliate-program.amazon.com/creatorsapi/docs/en-us/search-items.html). \n* \"\\_ASIN\\_\" : Accepts (ISBN), Amazon Standard Identification Number (*your locale*), [More](https://affiliate-program.amazon.com/creatorsapi/docs/en-us/get-items.html#ItemLookup-rp). \n* \"\\_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). \n\n### Quickstart\n\n**Recommended** using *Apaapi Builder* or *Apaapi Product* (Scraped data) if you dont have API credentials.\n\n[![Product](assets/product.png)](#Quickstart)\n\n#### Builder:\n\n```php\n\n/**\n * @see Use Composer, \n * Or include Apaapi Autoloader Here.\n */\n\nuse Apaapi\\includes\\Builder;\n\n// (1) Init request builder\n$builder = new Builder('_CREDENTIAL_ID_', '_CREDENTIAL_SECRET_', '_TAG_', '_LOCALE_');\n\n// (2) Get response (Search)\n$data = $builder-\u003esearchOne('Sony Xperia 1 VI'); // Normalized array\n\n```\n\n\u003e [!Note]  \n\u003e *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)*\n\n#### Product:\n\n```php\n\n/**\n * @see Use Composer, \n * Or include Apaapi Autoloader Here.\n */\n\nuse Apaapi\\includes\\Product;\n\n// (1) Init product\n$product = new Product('B00NLZUM36', 'com', 'test-21');\n\n// (2) Get response\n$data = $product-\u003eget(); // Array\n\n```\n\n\u003e [!Note]  \n\u003e *See full product usage at [/wiki/Product](https://github.com/Jakiboy/apaapi/wiki/Product)*\n### Rating:\n\nGet customer reviews of product as average rating and count (Scraped data).\n\n[![Rating](assets/rating.png)](#Rating)\n\n```php\n\nuse Apaapi\\includes\\Rating;\n\n// Init Rating\n$rating = new Rating('B00NLZUM36', 'com', 'test-21');\n\n// Get Response\n$data = $rating-\u003eget(); // Array\n\n```\n\n### Cart:\n\nGet affiliate cart URL.\n\n[![Cart](assets/cart.png)](#Cart)\n\n```php\n\nuse Apaapi\\lib\\Cart;\n\n// Init Cart\n$cart = new Cart();\n$cart-\u003esetLocale('com')-\u003esetPartnerTag('test-21');\n\n// Get Response\n$data = $cart-\u003eset(['B00NLZUM36' =\u003e 3]); // String\n\n```\n\n## ⚡ Advanced\n\n### Basic (Search):\n\nExtensible search method.\n\n```php\n\nuse Apaapi\\operations\\SearchItems;\nuse Apaapi\\lib\\Request;\nuse Apaapi\\lib\\Response;\n\n// (1) Set operation\n$operation = new SearchItems();\n$operation-\u003esetPartnerTag('_TAG_')-\u003esetKeywords('_KEYWORDS_');\n\n// (2) Prapere request\n$request = new Request('_CREDENTIAL_ID_', '_CREDENTIAL_SECRET_');\n$request-\u003esetLocale('_LOCALE_')-\u003esetPayload($operation);\n\n// (3) Get response\n$response = new Response($request);\n$data = $response-\u003eget(); // Array\n\n```\n\u003e [!Note]  \n\u003e *See all available TLDs used by setLocale() at [/wiki/TLDs](https://github.com/Jakiboy/apaapi/wiki/TLDs)*\n\n### Basic (Get):\n\nExtensible get method.\n\n```php\n\nuse Apaapi\\operations\\GetItems;\nuse Apaapi\\lib\\Request;\nuse Apaapi\\lib\\Response;\n\n// Set operation\n$operation = new GetItems();\n$operation-\u003esetPartnerTag('_TAG_')-\u003esetItemIds(['_ASIN_']);\n\n// Prapere request\n$request = new Request('_CREDENTIAL_ID_', '_CREDENTIAL_SECRET_');\n$request-\u003esetLocale('_LOCALE_')-\u003esetPayload($operation);\n\n// Get response\n$response = new Response($request);\n$data = $response-\u003eget(); // Array\n\n```\n\n### Operations:\n\nAll available operations.\n\n```php\n\nuse Apaapi\\operations\\GetItems;\nuse Apaapi\\operations\\SearchItems;\nuse Apaapi\\operations\\GetVariations;\nuse Apaapi\\operations\\GetBrowseNodes;\n\n// (1) GetItems\n$operation = new GetItems();\n$operation-\u003esetPartnerTag('_TAG_');\n$operation-\u003esetItemIds(['_ASIN_']); // Array\n\n// (2) SearchItems\n$operation = new SearchItems();\n$operation-\u003esetPartnerTag('_TAG_');\n$operation-\u003esetKeywords('_KEYWORDS_'); // String\n\n// (3) GetVariations\n$operation = new GetVariations();\n$operation-\u003esetPartnerTag('_TAG_');\n$operation-\u003esetASIN('_ASIN_'); // String\n\n// (4) GetBrowseNodes\n$operation = new GetBrowseNodes();\n$operation-\u003esetPartnerTag('_TAG_');\n$operation-\u003esetBrowseNodeIds(['_NODE_']); // Array\n\n```\n\n### Resources:\n\nOptimize response time by setting only the needed resources.\n\n```php\n\nuse Apaapi\\operations\\SearchItems;\n\n// Set Operation\n$operation = new SearchItems();\n$operation-\u003esetPartnerTag('_TAG_')-\u003esetKeywords('_KEYWORDS_');\n\n// Set Resources (3)\n$operation-\u003esetResources(['images.primary.small', 'itemInfo.title', 'offersV2.listings.price']);\n\n```\n\n\u003e [!Note]  \n\u003e *See all available resources used by setResources() at [/wiki/Resources](https://github.com/Jakiboy/apaapi/wiki/Resources)*\n\n## Authors\n\n* [Jakiboy](https://github.com/Jakiboy) (*Initial work*)\n* [Contributors](https://github.com/Jakiboy/apaapi/graphs/contributors)\n* [Any PR is welcome!](./CODE-OF-CONDUCT.md)\n\n### ⭐ Support:\n\nSkip the coffee! If you like the project, a **Star** would mean a lot.\n\n\u003e [!IMPORTANT]  \n\u003e *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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakiboy%2Fapaapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakiboy%2Fapaapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakiboy%2Fapaapi/lists"}