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 "noticeId": "W1",
14 "company": "Acme",
15 "employeesAffected": 400,
16 "state": "CA",
17 "noticeDate": "2026-08-01"
18 },
19 {
20 "noticeId": "W2",
21 "company": "Acme",
22 "employeesAffected": 250,
23 "state": "TX",
24 "noticeDate": "2026-08-15"
25 },
26 {
27 "noticeId": "W3",
28 "company": "Beta",
29 "employeesAffected": 100,
30 "state": "NY",
31 "noticeDate": "2026-08-10"
32 }
33 ],
34 "previousItems": [
35 {
36 "noticeId": "P1",
37 "company": "Acme",
38 "employeesAffected": 150,
39 "state": "CA",
40 "noticeDate": "2026-05-01"
41 }
42 ]
43};
44
45
46const run = await client.actor("quanmatrix/warn-layoff-distress-intelligence").call(input);
47
48
49console.log('Results from dataset');
50console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
51const { items } = await client.dataset(run.defaultDatasetId).listItems();
52items.forEach((item) => {
53 console.dir(item);
54});
55
56