1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "providedRecords": [
12 {
13 "productUrl": "https://example.com/owned-product/1",
14 "productTitle": "Owned example product",
15 "reviewTitle": "Clear instructions",
16 "reviewText": "This owned demonstration review describes clear instructions and a useful product.",
17 "reviewRating": 4
18 },
19 {
20 "productUrl": "https://example.com/owned-product/1",
21 "productTitle": "Owned example product",
22 "reviewTitle": "Useful with limits",
23 "reviewText": "This customer-authored example found the product useful but its packaging could improve.",
24 "reviewRating": 3
25 },
26 {
27 "productUrl": "https://example.com/owned-product/1",
28 "productTitle": "Owned example product",
29 "reviewTitle": "Unrated example",
30 "reviewText": "This owned demonstration review has no rating. It should not add a fabricated zero."
31 }
32 ],
33 "productUrls": [
34 "https://www.ulta.com/p/lash-princess-false-lash-effect-mascara-xlsImpprod12741009"
35 ],
36 "searchTerms": []
37};
38
39
40const run = await client.actor("thescrapelab/warehouse-grocery-review-intelligence-scraper").call(input);
41
42
43console.log('Results from dataset');
44console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
45const { items } = await client.dataset(run.defaultDatasetId).listItems();
46items.forEach((item) => {
47 console.dir(item);
48});
49
50