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": "Seattle, WA"
16 },
17 {
18 "query": "plumbers",
19 "location": "Austin, TX"
20 }
21 ],
22 "placesPerQuery": 20,
23 "excludeClosed": true,
24 "fetchPlaceDetails": true,
25 "fetchEmails": false,
26 "language": "en",
27 "country": "us",
28 "maxItems": 10000,
29 "proxyConfiguration": {
30 "useApifyProxy": true,
31 "apifyProxyGroups": [
32 "RESIDENTIAL"
33 ],
34 "apifyProxyCountry": "US"
35 }
36};
37
38
39const run = await client.actor("b2b_leads/bing-maps-real-time-data").call(input);
40
41
42console.log('Results from dataset');
43console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
44const { items } = await client.dataset(run.defaultDatasetId).listItems();
45items.forEach((item) => {
46 console.dir(item);
47});
48
49