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 "what": "industrial packaging",
15 "country": "Germany",
16 "maxResults": 10
17 },
18 {
19 "what": "adhesive tape",
20 "maxResults": 10
21 }
22 ],
23 "maxResultsPerTask": 10,
24 "enableLeadDetails": true,
25 "maxProductsPerCompany": 10,
26 "maxItems": 10000,
27 "concurrency": 5,
28 "delayBetweenRequestsMs": 250,
29 "proxyConfiguration": {
30 "useApifyProxy": true,
31 "apifyProxyGroups": [
32 "RESIDENTIAL"
33 ],
34 "apifyProxyCountry": "US"
35 }
36};
37
38
39const run = await client.actor("b2b_leads/europages-real-time-data-scraper").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