1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "enableProSearch": true,
12 "searchTasks": [
13 {
14 "category": "handyman",
15 "location": "Austin, TX",
16 "maxResults": 10
17 }
18 ],
19 "maxResultsPerTask": 10,
20 "maxRelatedCategoriesPerTask": 4,
21 "enableLeadDetails": true,
22 "enableProDetails": false,
23 "proUrls": [],
24 "maxReviewsPerPro": 10,
25 "enableReviews": false,
26 "reviewUrls": [],
27 "enableScrapeByUrl": false,
28 "scrapeUrls": [],
29 "maxItems": 10,
30 "webhookUrl": "",
31 "webhookFormat": "json",
32 "proxyConfiguration": {
33 "useApifyProxy": true,
34 "apifyProxyGroups": [
35 "RESIDENTIAL"
36 ],
37 "apifyProxyCountry": "US"
38 }
39};
40
41
42const run = await client.actor("b2b_leads/thumbtack-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