1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "businesses": [
12 {
13 "website": "https://mortenmyrmel03.github.io/lbpq-demo-sites/summit-ridge-roofing/",
14 "clientRecordId": "demo-001",
15 "businessName": "Summit Ridge Roofing",
16 "country": "US",
17 "city": "Austin"
18 },
19 {
20 "website": "https://mortenmyrmel03.github.io/lbpq-demo-sites/clearwater-plumbing/",
21 "clientRecordId": "demo-002",
22 "businessName": "Clearwater Plumbing Co.",
23 "country": "US",
24 "city": "Denver"
25 },
26 {
27 "website": "mortenmyrmel03.github.io/lbpq-demo-sites/clearwater-plumbing",
28 "clientRecordId": "demo-003",
29 "businessName": "Clearwater Plumbing Co. (duplicate CRM row)",
30 "country": "US",
31 "city": "Aurora"
32 },
33 {
34 "website": "https://mortenmyrmel03.github.io/lbpq-demo-sites/brightside-hvac/",
35 "clientRecordId": "demo-004",
36 "businessName": "Brightside HVAC"
37 },
38 {
39 "website": "https://mortenmyrmel03.github.io/lbpq-demo-sites/parked-domain-demo/",
40 "clientRecordId": "demo-005"
41 },
42 {
43 "website": "https://excluded-demo.example/",
44 "clientRecordId": "demo-006",
45 "businessName": "Excluded by input"
46 },
47 {
48 "website": "not a url",
49 "clientRecordId": "demo-007"
50 }
51 ],
52 "targetServiceCategories": [
53 "roofing",
54 "plumbing"
55 ],
56 "defaultCountry": "US",
57 "maxDomains": 20,
58 "maxPagesPerDomain": 4,
59 "excludedDomains": [
60 "excluded-demo.example"
61 ]
62};
63
64
65const run = await client.actor("mortenm/local-business-prospect-qualifier").call(input);
66
67
68console.log('Results from dataset');
69console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
70const { items } = await client.dataset(run.defaultDatasetId).listItems();
71items.forEach((item) => {
72 console.dir(item);
73});
74
75