1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "records": [
12 {
13 "placeId": "sample-place-001",
14 "title": "Example Cafe",
15 "stars": 5,
16 "publishedAtDate": "2026-01-11T11:00:00Z",
17 "text": "Friendly staff and delicious food."
18 },
19 {
20 "placeId": "sample-place-001",
21 "title": "Example Cafe",
22 "stars": 4,
23 "publishedAtDate": "2026-01-17T11:00:00Z",
24 "text": "Great service and clean tables."
25 },
26 {
27 "placeId": "sample-place-001",
28 "title": "Example Cafe",
29 "stars": 4,
30 "publishedAtDate": "2026-02-03T11:00:00Z",
31 "text": "Good atmosphere and reasonable price."
32 },
33 {
34 "placeId": "sample-place-001",
35 "title": "Example Cafe",
36 "stars": 3,
37 "publishedAtDate": "2026-02-09T11:00:00Z",
38 "text": "The wait time is slow."
39 },
40 {
41 "placeId": "sample-place-001",
42 "title": "Example Cafe",
43 "stars": 2,
44 "publishedAtDate": "2026-03-10T11:00:00Z",
45 "text": "Long wait and noisy seating."
46 },
47 {
48 "placeId": "sample-place-001",
49 "title": "Example Cafe",
50 "stars": 1,
51 "publishedAtDate": "2026-03-19T11:00:00Z",
52 "text": "Service was rude and the price is expensive."
53 },
54 {
55 "placeId": "sample-place-002",
56 "title": "Example Bakery",
57 "stars": 4,
58 "publishedAtDate": "2026-01-13T11:00:00Z",
59 "text": "Fresh bread and friendly staff."
60 },
61 {
62 "placeId": "sample-place-002",
63 "title": "Example Bakery",
64 "stars": 5,
65 "publishedAtDate": "2026-01-23T11:00:00Z",
66 "text": "Excellent value and delicious pastries."
67 },
68 {
69 "placeId": "sample-place-002",
70 "title": "Example Bakery",
71 "stars": 4,
72 "publishedAtDate": "2026-02-08T11:00:00Z",
73 "text": "Clean shop, parking is easy."
74 },
75 {
76 "placeId": "sample-place-002",
77 "title": "Example Bakery",
78 "stars": 5,
79 "publishedAtDate": "2026-02-14T11:00:00Z",
80 "text": "Great fresh quality."
81 },
82 {
83 "placeId": "sample-place-002",
84 "title": "Example Bakery",
85 "stars": 5,
86 "publishedAtDate": "2026-03-05T11:00:00Z",
87 "text": "Fantastic service and fair price."
88 },
89 {
90 "placeId": "sample-place-002",
91 "title": "Example Bakery",
92 "stars": 4,
93 "publishedAtDate": "2026-03-20T11:00:00Z",
94 "text": "Helpful staff and short wait."
95 },
96 {
97 "placeId": "sample-place-001",
98 "title": "Example Cafe",
99 "stars": 2,
100 "publishedAtDate": "2026-04-03T11:00:00Z",
101 "text": "Long wait and slow service"
102 },
103 {
104 "placeId": "sample-place-001",
105 "title": "Example Cafe",
106 "stars": 1,
107 "publishedAtDate": "2026-04-09T11:00:00Z",
108 "text": "Wait was long and staff were rude"
109 },
110 {
111 "placeId": "sample-place-001",
112 "title": "Example Cafe",
113 "stars": 2,
114 "publishedAtDate": "2026-04-15T11:00:00Z",
115 "text": "Overpriced, delayed order"
116 },
117 {
118 "placeId": "sample-place-001",
119 "title": "Example Cafe",
120 "stars": 1,
121 "publishedAtDate": "2026-05-02T11:00:00Z",
122 "text": "Dirty tables and poor service"
123 },
124 {
125 "placeId": "sample-place-001",
126 "title": "Example Cafe",
127 "stars": 2,
128 "publishedAtDate": "2026-05-11T11:00:00Z",
129 "text": "Slow service and long wait"
130 },
131 {
132 "placeId": "sample-place-001",
133 "title": "Example Cafe",
134 "stars": 1,
135 "publishedAtDate": "2026-05-21T11:00:00Z",
136 "text": "Staff were rude and the price was too expensive"
137 },
138 {
139 "placeId": "sample-place-002",
140 "title": "Example Bakery",
141 "stars": 5,
142 "publishedAtDate": "2026-04-01T11:00:00Z",
143 "text": "Friendly service and fresh bread",
144 "responseFromOwnerText": "Thank you for the feedback."
145 },
146 {
147 "placeId": "sample-place-002",
148 "title": "Example Bakery",
149 "stars": 5,
150 "publishedAtDate": "2026-04-07T11:00:00Z",
151 "text": "Excellent pastries and good value",
152 "responseFromOwnerText": "Thank you for the feedback."
153 },
154 {
155 "placeId": "sample-place-002",
156 "title": "Example Bakery",
157 "stars": 5,
158 "publishedAtDate": "2026-04-12T11:00:00Z",
159 "text": "Helpful staff and short wait",
160 "responseFromOwnerText": "Thank you for the feedback."
161 },
162 {
163 "placeId": "sample-place-002",
164 "title": "Example Bakery",
165 "stars": 4,
166 "publishedAtDate": "2026-05-03T11:00:00Z",
167 "text": "Lovely quality and friendly service",
168 "responseFromOwnerText": "Thank you for the feedback."
169 },
170 {
171 "placeId": "sample-place-002",
172 "title": "Example Bakery",
173 "stars": 5,
174 "publishedAtDate": "2026-05-13T11:00:00Z",
175 "text": "Good parking and excellent bread",
176 "responseFromOwnerText": "Thank you for the feedback."
177 },
178 {
179 "placeId": "sample-place-002",
180 "title": "Example Bakery",
181 "stars": 5,
182 "publishedAtDate": "2026-05-18T11:00:00Z",
183 "text": "Nice atmosphere and fresh pastries",
184 "responseFromOwnerText": "Thank you for the feedback."
185 }
186 ]
187};
188
189
190const run = await client.actor("practical_ai_lab_jp/pal-maps-reviews-sentiment-trends").call(input);
191
192
193console.log('Results from dataset');
194console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
195const { items } = await client.dataset(run.defaultDatasetId).listItems();
196items.forEach((item) => {
197 console.dir(item);
198});
199
200