Skip to content

Commit 7176c69

Browse files
authored
add docs on amazon product scrapingbee client (#17)
1 parent bbd8474 commit 7176c69

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,22 @@ Look at the source code of `src/LaravelScrapingBeeAmazonSearch.php` for the othe
167167

168168
[LaravelScrapingBeeAmazonSearch.php](https://github.com/ziming/laravel-scrapingbee/blob/main/src/LaravelScrapingBeeAmazonSearch.php)
169169

170+
#### The Amazon Product ScrapingBee Client
171+
172+
```php
173+
$amazonProductScrapingBeeClient = Ziming\LaravelScrapingBee\LaravelScrapingBeeAmazonProduct::make();
174+
175+
$response = $amazonProductScrapingBeeClient
176+
->query('ASIN')
177+
->device('desktop')
178+
->currency('usd')
179+
->country('gb')
180+
->get();
181+
```
182+
183+
Look at the source code of `src/LaravelScrapingBeeAmazonProduct.php` for the other methods (link below).
184+
[LaravelScrapingBeeAmazonProduct.php](https://github.com/ziming/laravel-scrapingbee/blob/main/src/LaravelScrapingBeeAmazonProduct.php)
185+
170186
## Testing
171187

172188
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.

src/LaravelScrapingBeeAmazonProduct.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,20 @@ public function query(string $productAsin): self
6666
return $this;
6767
}
6868

69+
/**
70+
* Alias for query method
71+
*
72+
* ASIN stands for Amazon Standard Identification Number
73+
*
74+
* @see query()
75+
*/
76+
public function asin(string $productAsin): self
77+
{
78+
$this->params['query'] = $productAsin;
79+
80+
return $this;
81+
}
82+
6983
/**
7084
* https://www.scrapingbee.com/documentation/amazon/#device_AmazonProduct
7185
*/

0 commit comments

Comments
 (0)