1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "search_query": "cafe",
12 "location": "Lower Manhattan, New York, USA",
13 "max_results": 5,
14 "language": "en",
15 "search_mode": "single",
16 "detailProfile": "core",
17 "detailTransport": "feed",
18 "geographicOptions": {
19 "resultLimit": 10
20 },
21 "maxRunTimeSecs": 60,
22 "maxSearchCells": 1,
23 "maxSearchAttempts": 1,
24 "maxNavigationAttempts": 12,
25 "maxCandidateUrls": 10,
26 "maxConcurrentSearches": 1,
27 "maxConcurrentExtractions": 1,
28 "baseDelayMs": 500,
29 "enableCache": false,
30 "captureDetailEvidence": false,
31 "proxyConfiguration": {
32 "useApifyProxy": false
33 }
34};
35
36
37const run = await client.actor("computerdoit/google-maps-leads-scraper").call(input);
38
39
40console.log('Results from dataset');
41console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
42const { items } = await client.dataset(run.defaultDatasetId).listItems();
43items.forEach((item) => {
44 console.dir(item);
45});
46
47