1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "productUrls": [
12 {
13 "url": "https://www.homedepot.com/p/RYOBI-ONE-18V-Cordless-3-8-in-Drill-Driver-Kit-with-Battery-and-Charger-PCL201K1/339545347"
14 }
15 ],
16 "maxReviewsPerProduct": 20,
17 "sortBy": "newest",
18 "verifiedPurchasesOnly": false,
19 "starRatingFilter": [],
20 "keywordSearch": "",
21 "hasPhotosOnly": false,
22 "minHelpfulVotes": 0,
23 "monitorMode": false,
24 "stateName": "default",
25 "proxyConfiguration": {
26 "useApifyProxy": false
27 }
28};
29
30
31const run = await client.actor("getascraper/homedepot-reviews-scraper").call(input);
32
33
34console.log('Results from dataset');
35console.log(`πΎ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
36const { items } = await client.dataset(run.defaultDatasetId).listItems();
37items.forEach((item) => {
38 console.dir(item);
39});
40
41