diff --git a/README.md b/README.md index 0f8722f..8f2ff66 100644 --- a/README.md +++ b/README.md @@ -167,6 +167,22 @@ Look at the source code of `src/LaravelScrapingBeeAmazonSearch.php` for the othe [LaravelScrapingBeeAmazonSearch.php](https://github.com/ziming/laravel-scrapingbee/blob/main/src/LaravelScrapingBeeAmazonSearch.php) +#### The Amazon Product ScrapingBee Client + +```php +$amazonProductScrapingBeeClient = Ziming\LaravelScrapingBee\LaravelScrapingBeeAmazonProduct::make(); + +$response = $amazonProductScrapingBeeClient + ->query('ASIN') + ->device('desktop') + ->currency('usd') + ->country('gb') + ->get(); +``` + +Look at the source code of `src/LaravelScrapingBeeAmazonProduct.php` for the other methods (link below). +[LaravelScrapingBeeAmazonProduct.php](https://github.com/ziming/laravel-scrapingbee/blob/main/src/LaravelScrapingBeeAmazonProduct.php) + ## Testing Currently, there are no tests as it uses credits. But if there are tests in the future, you can run the command below to execute the testcases. diff --git a/src/LaravelScrapingBeeAmazonProduct.php b/src/LaravelScrapingBeeAmazonProduct.php index 5c8bb30..44c84fb 100644 --- a/src/LaravelScrapingBeeAmazonProduct.php +++ b/src/LaravelScrapingBeeAmazonProduct.php @@ -66,6 +66,20 @@ public function query(string $productAsin): self return $this; } + /** + * Alias for query method + * + * ASIN stands for Amazon Standard Identification Number + * + * @see query() + */ + public function asin(string $productAsin): self + { + $this->params['query'] = $productAsin; + + return $this; + } + /** * https://www.scrapingbee.com/documentation/amazon/#device_AmazonProduct */