1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "searchStringsArray": [
12 "restaurant"
13 ],
14 "locationQueries": [
15 "New York, USA"
16 ],
17 "maxCrawledPlacesPerSearch": 10,
18 "language": "en",
19 "mode": "FULL",
20 "scrapeContacts": true,
21 "maxContactPages": 1,
22 "scrapeReviews": false,
23 "maxReviews": 0,
24 "outputMode": "PLACE_ITEMS",
25 "scrapePlaceDetailPage": true,
26 "maxImages": 5,
27 "rawOutput": false,
28 "countryCode": "US",
29 "maxConcurrency": 2,
30 "maxRetries": 3,
31 "maxProxyRetries": 3,
32 "proxy": {
33 "useApifyProxy": true,
34 "apifyProxyGroups": [
35 "RESIDENTIAL"
36 ],
37 "apifyProxyCountry": "US"
38 }
39};
40
41
42const run = await client.actor("trakk/google-maps-business-intelligence").call(input);
43
44
45console.log('Results from dataset');
46console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
47const { items } = await client.dataset(run.defaultDatasetId).listItems();
48items.forEach((item) => {
49 console.dir(item);
50});
51
52