1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "reviews": [
12 {
13 "text": "Delivery took three weeks and nobody answered my emails.",
14 "rating": 1,
15 "date": "2026-11-28"
16 },
17 {
18 "text": "Great quality, fits perfectly. Will order again!",
19 "rating": 5,
20 "date": "2026-11-27"
21 },
22 {
23 "text": "Good product but shipping costs are too high.",
24 "rating": 3,
25 "date": "2026-11-25"
26 },
27 {
28 "text": "Support solved my issue in 10 minutes, thank you.",
29 "rating": 5,
30 "date": "2026-11-22"
31 },
32 {
33 "text": "The size chart is wrong, I had to return it.",
34 "rating": 2,
35 "date": "2026-11-20"
36 }
37 ]
38};
39
40
41const run = await client.actor("macgitarra/ai-review-analyzer").call(input);
42
43
44console.log('Results from dataset');
45console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
46const { items } = await client.dataset(run.defaultDatasetId).listItems();
47items.forEach((item) => {
48 console.dir(item);
49});
50
51