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