1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "enableCitySearch": true,
12 "cityTasks": [
13 {
14 "category": "steuerberater",
15 "city": "berlin",
16 "maxResults": 10
17 },
18 {
19 "category": "zahnarzt",
20 "city": "münchen",
21 "maxResults": 10
22 }
23 ],
24 "enableKeywordSearch": false,
25 "keywordTasks": [
26 {
27 "keyword": "buchhaltung",
28 "maxResults": 10
29 }
30 ],
31 "enableEnrichment": false,
32 "enableListingDetails": false,
33 "enableLeadDetails": false,
34 "enableReviews": false,
35 "concurrency": 2,
36 "proxyConfiguration": {
37 "useApifyProxy": true,
38 "apifyProxyGroups": [
39 "RESIDENTIAL"
40 ],
41 "apifyProxyCountry": "US"
42 }
43};
44
45
46const run = await client.actor("b2b_leads/gelbe-seiten-real-time-data-scraper").call(input);
47
48
49console.log('Results from dataset');
50console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
51const { items } = await client.dataset(run.defaultDatasetId).listItems();
52items.forEach((item) => {
53 console.dir(item);
54});
55
56