1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "states": [
12 "TX",
13 "FL",
14 "CA"
15 ],
16 "cities": [
17 "Dallas",
18 "Miami"
19 ],
20 "tradeKeywordsOrCsiCodes": [
21 "Electrical",
22 "HVAC",
23 "Concrete"
24 ],
25 "companyTypes": [
26 "General Contractor",
27 "Subcontractor"
28 ],
29 "certificationsFilter": [],
30 "startUrls": [],
31 "maxItems": 20,
32 "proxyConfiguration": {
33 "useApifyProxy": true
34 }
35};
36
37
38const run = await client.actor("unique_dev/thebluebook-commercial-contractors-scraper").call(input);
39
40
41console.log('Results from dataset');
42console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
43const { items } = await client.dataset(run.defaultDatasetId).listItems();
44items.forEach((item) => {
45 console.dir(item);
46});
47
48