1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "enableSearch": true,
12 "searchTasks": [
13 {
14 "query": "coffee shops",
15 "location": "Austin, TX",
16 "placesPerQuery": 10
17 },
18 {
19 "query": "pizza",
20 "location": "Chicago, IL",
21 "placesPerQuery": 10
22 }
23 ],
24 "placesPerQuery": 10,
25 "enableLeadDetails": false,
26 "fetchPlaceDetails": true,
27 "language": "en-US",
28 "country": "us",
29 "maxItems": 10000,
30 "proxyConfiguration": {
31 "useApifyProxy": true,
32 "apifyProxyGroups": [
33 "RESIDENTIAL"
34 ],
35 "apifyProxyCountry": "US"
36 }
37};
38
39
40const run = await client.actor("b2b_leads/apple-maps-real-time-data-scraper").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