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 "keyword": "plumbers",
15 "location": "Austin, TX",
16 "maxResults": 10
17 },
18 {
19 "keyword": "roofing",
20 "location": "Dallas, TX",
21 "maxResults": 10
22 }
23 ],
24 "maxPagesPerTask": 5,
25 "enableSimpleSearch": false,
26 "maxResultsPerTask": 10,
27 "country": "US",
28 "enableLeadDetails": true,
29 "maxItems": 10000,
30 "concurrency": 4,
31 "delayBetweenRequestsMs": 1200,
32 "proxyConfiguration": {
33 "useApifyProxy": true,
34 "apifyProxyGroups": [
35 "RESIDENTIAL"
36 ],
37 "apifyProxyCountry": "US"
38 }
39};
40
41
42const run = await client.actor("b2b_leads/hotfrog-real-time-data-scraper").call(input);
43
44
45console.log('Results from dataset');
46console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
47const { items } = await client.dataset(run.defaultDatasetId).listItems();
48items.forEach((item) => {
49 console.dir(item);
50});
51
52