1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "triggers": {
12 "conditions": [
13 {
14 "type": "rating_below",
15 "threshold": 3.5,
16 "severity": "high"
17 },
18 {
19 "type": "negative_review_ratio",
20 "threshold": 0.4,
21 "severity": "high"
22 },
23 {
24 "type": "bbb_complaints_above",
25 "threshold": 5,
26 "severity": "medium"
27 },
28 {
29 "type": "social_presence_missing",
30 "threshold": 2,
31 "severity": "low"
32 },
33 {
34 "type": "negative_news",
35 "threshold": 1,
36 "severity": "critical",
37 "keywords": [
38 "lawsuit",
39 "shutdown",
40 "fraud",
41 "violation"
42 ]
43 },
44 {
45 "type": "personnel_change",
46 "threshold": 1,
47 "severity": "medium"
48 },
49 {
50 "type": "hiring_surge",
51 "threshold": 10,
52 "severity": "medium"
53 },
54 {
55 "type": "financial_decline",
56 "threshold": 2,
57 "severity": "high"
58 },
59 {
60 "type": "saas_outage",
61 "threshold": 1,
62 "severity": "high"
63 },
64 {
65 "type": "location_expansion",
66 "threshold": 5,
67 "severity": "low"
68 },
69 {
70 "type": "heavy_advertiser",
71 "threshold": 20,
72 "severity": "low"
73 },
74 {
75 "type": "no_advertising",
76 "severity": "medium"
77 },
78 {
79 "type": "patent_activity",
80 "threshold": 1,
81 "severity": "low"
82 }
83 ],
84 "actions": {
85 "email": {
86 "enabled": false,
87 "webhookUrl": "",
88 "to": "owner@business.com",
89 "subjectTemplate": "[Dossier Alert] {triggerCount} issue(s) found for {businessName}"
90 },
91 "crm": {
92 "enabled": false,
93 "type": "salesforce",
94 "webhookUrl": "",
95 "authHeader": "Bearer YOUR_TOKEN",
96 "objectType": "Task",
97 "customFields": {}
98 },
99 "slack": {
100 "enabled": false,
101 "webhookUrl": ""
102 },
103 "webhook": {
104 "enabled": false,
105 "url": "",
106 "method": "POST",
107 "headers": {},
108 "customData": {}
109 },
110 "includeFullReport": false
111 }
112 }
113};
114
115
116const run = await client.actor("apricot_blackberry/small-business-osint").call(input);
117
118
119console.log('Results from dataset');
120console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
121const { items } = await client.dataset(run.defaultDatasetId).listItems();
122items.forEach((item) => {
123 console.dir(item);
124});
125
126