1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "search": {
12 "searchTerms": [
13 "dentist"
14 ],
15 "locations": [
16 "Jackson Heights NY"
17 ],
18 "numberOfPlaces": 20
19 },
20 "lead_generation": {
21 "placeInput": "",
22 "searchTerms": [
23 "dentist"
24 ],
25 "locations": [
26 "Jackson Heights NY"
27 ],
28 "numberOfPlaces": 20,
29 "enrichDetails": false,
30 "enrichWebsites": false,
31 "enrichGoogleWebResults": false,
32 "maxReviews": 20
33 }
34};
35
36
37const run = await client.actor("crawlio/google-maps-lead-extractor").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