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 "companyId": "CMP1",
14 "company": "Acme Cloud",
15 "department": "Engineering",
16 "headcount": 115,
17 "category": "growth",
18 "date": "2026-10-12"
19 },
20 {
21 "companyId": "CMP2",
22 "company": "Beta Systems",
23 "department": "Sales",
24 "headcount": 78,
25 "category": "growth",
26 "date": "2026-10-12"
27 },
28 {
29 "companyId": "CMP3",
30 "company": "Gamma Labs",
31 "department": "R&D",
32 "headcount": 41,
33 "category": "stable",
34 "date": "2026-10-12"
35 }
36 ],
37 "previousItems": [
38 {
39 "companyId": "CMP1",
40 "company": "Acme Cloud",
41 "department": "Engineering",
42 "headcount": 105,
43 "category": "growth",
44 "date": "2026-10-05"
45 },
46 {
47 "companyId": "CMP2",
48 "company": "Beta Systems",
49 "department": "Sales",
50 "headcount": 85,
51 "category": "decline",
52 "date": "2026-10-05"
53 }
54 ]
55};
56
57
58const run = await client.actor("quanmatrix/linkedin-company-workforce-snapshot-analyzer").call(input);
59
60
61console.log('Results from dataset');
62console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
63const { items } = await client.dataset(run.defaultDatasetId).listItems();
64items.forEach((item) => {
65 console.dir(item);
66});
67
68