2017 © Pedro Peláez
 

library laravel-amazon-product-api

Amazon Product Advertising API for Laravel

image

revolution/laravel-amazon-product-api

Amazon Product Advertising API for Laravel

  • Sunday, June 17, 2018
  • by revolution
  • Repository
  • 4 Watchers
  • 11 Stars
  • 2,419 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 1 Open issues
  • 13 Versions
  • 28 % Grown

The README.md

Amazon Product Advertising API for Laravel

Build Status Maintainability Test Coverage, (*1)

End of active support (2020/06)

My API account has been banned, so my active support is over. However, PR is accepted., (*2)

Requirements

  • PHP >= 8.2
  • Laravel >= 11.0

Versioning

  • Basic : semver
  • Drop old PHP or Laravel version : +0.1. composer should handle it well.
  • Support only latest major version (master branch), but you can PR to old branches.

Installation

Composer

composer require revolution/laravel-amazon-product-api

Publishing config (Optional)

php artisan vendor:publish --tag=amazon-product-config

.env

AMAZON_API_KEY=
AMAZON_API_SECRET_KEY=
AMAZON_ASSOCIATE_TAG=
AMAZON_HOST=webservices.amazon.com
AMAZON_REGION=us-east-1

Country lists

https://webservices.amazon.com/paapi5/documentation/common-request-parameters.html, (*3)

Note

  • API Rate limit https://webservices.amazon.com/paapi5/documentation/troubleshooting/api-rates.html

Usage

<?php
use Revolution\Amazon\ProductAdvertising\Facades\AmazonProduct;

# string $category, string $keyword = null, int $page = 1
$response = AmazonProduct::search(category: 'All', keyword: 'amazon' , page: 1);
dd($response);
# returns normal array

# string $browse Browse node
$response = AmazonProduct::browse(node: '1');

# string $asin ASIN
$response = AmazonProduct::item(asin: 'ASIN1');

# array $asin ASIN
$response = AmazonProduct::items(asin: ['ASIN1', 'ASIN2']);

# setIdType: support only item() and items()
$response = AmazonProduct::setIdType(idType: 'EAN')->item(asin: 'EAN');
# reset to ASIN
AmazonProduct::setIdType(idType: 'ASIN');
# PA-APIv5 not support EAN?

browse() is not contains detail data., (*4)

use Revolution\Amazon\ProductAdvertising\Facades\AmazonProduct;

$response = AmazonProduct::browse(node: '1');
$nodes = data_get($response, 'BrowseNodesResult');
$items = data_get($nodes, 'BrowseNodes.TopSellers.TopSeller');
$asins = data_get($items, '*.ASIN');
$results = AmazonProduct::items(asin: $asins);
# PA-APIv5 not support TopSeller?

Probably, you need try-catch or Laravel's rescue() helper., (*5)

use Revolution\Amazon\ProductAdvertising\Facades\AmazonProduct;

try {
    $response = AmazonProduct::browse(node: '1');
} catch(ApiException $e) {

}

$response = rescue(function () use ($browse_id) {
                return AmazonProduct::browse(node: $browse_id);
            }, []);

LICENSE

MIT
Copyright kawax, (*6)

The Versions

17/06 2018

dev-master

9999999-dev

Amazon Product Advertising API for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

laravel amazon

17/06 2018

1.0.1

1.0.1.0

Amazon Product Advertising API for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

laravel amazon

16/05 2018

1.0.0

1.0.0.0

Amazon Product Advertising API for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

laravel amazon

16/12 2017

0.4.0

0.4.0.0

Amazon Product Advertising API for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

laravel amazon

13/11 2017

0.3.0

0.3.0.0

Amazon Product Advertising API for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

laravel amazon

12/10 2017

0.2.6

0.2.6.0

Amazon Product Advertising API for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

laravel amazon

11/10 2017

0.2.5

0.2.5.0

Amazon Product Advertising API for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

laravel amazon

11/10 2017

0.2.4

0.2.4.0

Amazon Product Advertising API for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

laravel amazon

25/09 2017

0.2.3

0.2.3.0

Amazon Product Advertising API for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

laravel amazon

24/09 2017

0.2.2

0.2.2.0

Amazon Product Advertising API for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

laravel amazon

19/09 2017

0.2.1

0.2.1.0

Amazon Product Advertising API for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

laravel amazon

17/09 2017

0.2.0

0.2.0.0

Amazon Product Advertising API for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

laravel amazon

15/09 2017

0.1.0

0.1.0.0

Amazon Product Advertising API for Laravel

  Sources   Download

MIT

The Requires

 

The Development Requires

by kawax

laravel amazon