Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
14 changes: 14 additions & 0 deletions src/LaravelScrapingBeeAmazonProduct.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down