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 "title": "Café Aurora",
14 "stars": 5,
15 "publishedAtDate": "2026-10-02",
16 "text": "Best flat white in town and the staff is super friendly. A bit pricey though."
17 },
18 {
19 "title": "Café Aurora",
20 "stars": 2,
21 "publishedAtDate": "2026-10-05",
22 "text": "Waited 25 minutes for two coffees. Nobody apologized."
23 },
24 {
25 "title": "Café Aurora",
26 "stars": 4,
27 "publishedAtDate": "2026-10-09",
28 "text": "Lovely pastries, cozy place. Wish they had oat milk and more seats."
29 },
30 {
31 "title": "Café Aurora",
32 "stars": 1,
33 "publishedAtDate": "2026-10-12",
34 "text": "Card machine was broken and they only took cash. Very slow service."
35 },
36 {
37 "title": "Café Aurora",
38 "stars": 5,
39 "publishedAtDate": "2026-10-15",
40 "text": "Amazing croissants, friendly baristas, great wifi to work."
41 },
42 {
43 "title": "Café Aurora",
44 "stars": 3,
45 "publishedAtDate": "2026-10-20",
46 "text": "Good coffee but too noisy and the wait was long at lunch time."
47 },
48 {
49 "title": "Café Aurora",
50 "stars": 5,
51 "publishedAtDate": "2026-10-22",
52 "text": "El mejor café de la zona, el personal muy amable."
53 },
54 {
55 "title": "Café Aurora",
56 "stars": 2,
57 "publishedAtDate": "2026-10-28",
58 "text": "Prices went up again and the portions are smaller. Disappointed."
59 }
60 ]
61};
62
63
64const run = await client.actor("datatools-ai/review-insights-ai").call(input);
65
66
67console.log('Results from dataset');
68console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
69const { items } = await client.dataset(run.defaultDatasetId).listItems();
70items.forEach((item) => {
71 console.dir(item);
72});
73
74