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 "locationName": "Harbor Cafe",
14 "rating": 1,
15 "publishedAt": "2026-10-20",
16 "text": "Long wait and the staff were rude."
17 },
18 {
19 "locationName": "Harbor Cafe",
20 "rating": 2,
21 "publishedAt": "2026-10-18",
22 "text": "Wrong order and slow service."
23 },
24 {
25 "locationName": "Harbor Cafe",
26 "rating": 5,
27 "publishedAt": "2026-10-05",
28 "text": "Great coffee."
29 },
30 {
31 "locationName": "Harbor Cafe",
32 "rating": 5,
33 "publishedAt": "2026-09-10",
34 "text": "Lovely place."
35 },
36 {
37 "locationName": "Harbor Cafe",
38 "rating": 4,
39 "publishedAt": "2026-09-12",
40 "text": "Good."
41 },
42 {
43 "locationName": "Harbor Cafe",
44 "rating": 5,
45 "publishedAt": "2026-09-15",
46 "text": "Friendly."
47 },
48 {
49 "locationName": "Central Gym",
50 "rating": 1,
51 "publishedAt": "2026-10-22",
52 "text": "Dirty showers and a bad smell."
53 },
54 {
55 "locationName": "Central Gym",
56 "rating": 2,
57 "publishedAt": "2026-10-15",
58 "text": "Locker room is filthy."
59 },
60 {
61 "locationName": "Central Gym",
62 "rating": 4,
63 "publishedAt": "2026-10-10",
64 "text": "Good equipment."
65 },
66 {
67 "locationName": "Park Dental",
68 "rating": 5,
69 "publishedAt": "2026-10-21",
70 "text": "Quick and clean."
71 },
72 {
73 "locationName": "Park Dental",
74 "rating": 4,
75 "publishedAt": "2026-10-12",
76 "text": "Fine visit."
77 },
78 {
79 "locationName": "Park Dental",
80 "rating": 2,
81 "publishedAt": "2026-10-02",
82 "text": "Billing mistake, charged twice."
83 }
84 ]
85};
86
87
88const run = await client.actor("practical_ai_lab_jp/pal-maps-reviews-response-prioritizer").call(input);
89
90
91console.log('Results from dataset');
92console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
93const { items } = await client.dataset(run.defaultDatasetId).listItems();
94items.forEach((item) => {
95 console.dir(item);
96});
97
98