1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "currentItems": [
12 {
13 "reviewId": "r1",
14 "productUrl": "https://shopee.sg/product-i.1.101",
15 "content": "Battery stopped charging after two days. Very disappointed.",
16 "rating": 1,
17 "likeCount": 38,
18 "variation": "Black"
19 },
20 {
21 "reviewId": "r2",
22 "productUrl": "https://shopee.sg/product-i.1.101",
23 "content": "Great sound and fast delivery, highly recommend.",
24 "rating": 5,
25 "likeCount": 14,
26 "sellerReply": "Thank you!"
27 },
28 {
29 "reviewId": "r3",
30 "productUrl": "https://shopee.sg/product-i.1.101",
31 "content": "Delivery was late and the box was damaged.",
32 "rating": 2,
33 "likeCount": 22
34 }
35 ]
36};
37
38
39const run = await client.actor("quanmatrix/shopee-reviews-buyer-feedback-scraper").call(input);
40
41
42console.log('Results from dataset');
43console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
44const { items } = await client.dataset(run.defaultDatasetId).listItems();
45items.forEach((item) => {
46 console.dir(item);
47});
48
49