1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "currentItems": [
12 {
13 "eventId": "x1",
14 "company": "Acme Corp",
15 "person": "CEO A",
16 "role": "CEO",
17 "seniority": "C-Suite",
18 "moveType": "departure",
19 "seniorityWeight": 100,
20 "date": "2026-09-01"
21 },
22 {
23 "eventId": "x2",
24 "company": "Acme Corp",
25 "person": "CFO B",
26 "role": "CFO",
27 "seniority": "C-Suite",
28 "moveType": "departure",
29 "seniorityWeight": 95,
30 "date": "2026-09-04"
31 },
32 {
33 "eventId": "x3",
34 "company": "Beta Inc",
35 "person": "COO C",
36 "role": "COO",
37 "seniority": "C-Suite",
38 "moveType": "appointment",
39 "seniorityWeight": 90,
40 "date": "2026-09-05"
41 }
42 ],
43 "previousItems": [
44 {
45 "eventId": "x0",
46 "company": "Acme Corp",
47 "person": "VP D",
48 "role": "VP Sales",
49 "seniority": "VP",
50 "moveType": "departure",
51 "seniorityWeight": 55,
52 "date": "2026-06-01"
53 },
54 {
55 "eventId": "x3",
56 "company": "Beta Inc",
57 "person": "COO C",
58 "role": "VP Ops",
59 "seniority": "VP",
60 "moveType": "promotion",
61 "seniorityWeight": 70,
62 "date": "2026-06-10"
63 }
64 ]
65};
66
67
68const run = await client.actor("quanmatrix/executive-departure-cluster-intelligence").call(input);
69
70
71console.log('Results from dataset');
72console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
73const { items } = await client.dataset(run.defaultDatasetId).listItems();
74items.forEach((item) => {
75 console.dir(item);
76});
77
78