1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "reviewsJson": [
12 {
13 "placeName": "Downtown Specialty Coffee Roasters",
14 "reviews": [
15 {
16 "stars": 5,
17 "text": "Single origin espresso is phenomenal and the baristas are super friendly."
18 },
19 {
20 "stars": 5,
21 "text": "Best pour over coffee in the city with fast Wi-Fi for remote work."
22 },
23 {
24 "stars": 2,
25 "text": "Weekend wait time is over 25 minutes and seating is very cramped."
26 }
27 ]
28 }
29 ]
30};
31
32
33const run = await client.actor("invaluable_rondeau/google-maps-reviews-ai-competitive-report").call(input);
34
35
36console.log('Results from dataset');
37console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
38const { items } = await client.dataset(run.defaultDatasetId).listItems();
39items.forEach((item) => {
40 console.dir(item);
41});
42
43