1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "place_urls": [
12 "https://www.google.com/maps/place/Gate+City+Coffee/@42.8721827,-112.5145324,13z/data=!4m12!1m2!2m1!1scafe+near+me!3m8!1s0x53554f38893bbb89:0x222e4f25f9ee250!8m2!3d42.8620172!4d-112.4511824!9m1!1b1!15sCgxjYWZlIG5lYXIgbWUiA5ABAVoOIgxjYWZlIG5lYXIgbWWSAQtjb2ZmZWVfc2hvcKoBPhABKggiBGNhZmUoADIeEAEiGtpRAY4m-mMFxs0ifZy5vM6DMp9S9_hPUXd0MhAQAiIMY2FmZSBuZWFyIG1l4AEA!16s%2Fg%2F11t19c1zg9?entry=ttu&g_ep=EgoyMDI1MDYxMS4wIKXMDSoASAFQAw%3D%3D"
13 ],
14 "place_ids": [
15 "0x53554f38893bbb89:0x222e4f25f9ee250"
16 ],
17 "search": [
18 "restaurant"
19 ]
20};
21
22
23const run = await client.actor("web_wanderer/google-reviews-scraper").call(input);
24
25
26console.log('Results from dataset');
27console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
28const { items } = await client.dataset(run.defaultDatasetId).listItems();
29items.forEach((item) => {
30 console.dir(item);
31});
32
33