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": "general-contractor",
15 "location": "Austin, TX",
16 "maxResults": 10
17 }
18 ],
19 "maxResultsPerTask": 10,
20 "maxResultSetsPerTask": 8,
21 "enableLeadDetails": true,
22 "leadDetailsSiteLookups": 3,
23 "enableProfileDetails": false,
24 "profileUrls": [],
25 "enableReviews": false,
26 "reviewProfileUrls": [],
27 "maxItems": 10,
28 "webhookUrl": "",
29 "webhookFormat": "json",
30 "proxyConfiguration": {
31 "useApifyProxy": true,
32 "apifyProxyGroups": [
33 "RESIDENTIAL"
34 ],
35 "apifyProxyCountry": "US"
36 }
37};
38
39
40const run = await client.actor("b2b_leads/houzz-real-time-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