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 "id": "h1",
14 "company": "Acme",
15 "eventType": "hiring",
16 "role": "Engineer",
17 "openings": 45,
18 "netHiringSignal": 45
19 },
20 {
21 "id": "h2",
22 "company": "Acme",
23 "eventType": "hiring",
24 "role": "Sales",
25 "openings": 20,
26 "netHiringSignal": 20
27 }
28 ],
29 "previousItems": [
30 {
31 "id": "l1",
32 "company": "Acme",
33 "eventType": "layoff",
34 "affectedWorkers": 300,
35 "netHiringSignal": -300
36 }
37 ]
38};
39
40
41const run = await client.actor("quanmatrix/layoff-hiring-reversal-intelligence").call(input);
42
43
44console.log('Results from dataset');
45console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
46const { items } = await client.dataset(run.defaultDatasetId).listItems();
47items.forEach((item) => {
48 console.dir(item);
49});
50
51