1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "startUrls": [
12 "https://www.google.com/maps/place/Top+of+The+Rock/@40.7614367,-73.9802019,744m/data=!3m2!1e3!5s0x89c258fecf0c6825:0xb825fcec483ad5d5!4m14!1m7!3m6!1s0x89c258f97bdb102b:0xea9f8fc0b3ffff55!2sThe+Museum+of+Modern+Art!8m2!3d40.7614327!4d-73.9776216!16zL20vMGhoams!3m5!1s0x89c258ff31cabb7b:0xda17e23e0f1fc620!8m2!3d40.7593495!4d-73.9794087!16s%2Fg%2F11cmgnblyq?hl=en-US&entry=ttu&g_ep=EgoyMDI1MDMyNS4xIKXMDSoASAFQAw%3D%3D"
13 ],
14 "placeFIDs": [
15 "0x89c258f97bdb102b:0xea9f8fc0b3ffff55"
16 ],
17 "reviewIds": [
18 "ChdDSUhNMG9nS0VKZWc2ZG4wX1pxNTlnRRAB"
19 ],
20 "sort": "newest",
21 "language": "en",
22 "maxItems": 10,
23 "customMapFunction": (object) => { return {...object} }
24};
25
26
27const run = await client.actor("agents/google-maps-reviews").call(input);
28
29
30console.log('Results from dataset');
31console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
32const { items } = await client.dataset(run.defaultDatasetId).listItems();
33items.forEach((item) => {
34 console.dir(item);
35});
36
37