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": "c1",
14 "title": "Employer Alpha",
15 "rating": 2.8,
16 "negativePct": 66,
17 "turnoverMentionRate": 58,
18 "managementIssueRate": 63,
19 "salaryGapPct": 24,
20 "reviewCount": 4600
21 },
22 {
23 "id": "c2",
24 "title": "Employer Beta",
25 "rating": 4.2,
26 "negativePct": 18,
27 "turnoverMentionRate": 12,
28 "managementIssueRate": 17,
29 "salaryGapPct": 6,
30 "reviewCount": 3100
31 }
32 ],
33 "previousItems": [
34 {
35 "id": "c1",
36 "title": "Employer Alpha",
37 "rating": 3.4,
38 "negativePct": 48,
39 "turnoverMentionRate": 39,
40 "managementIssueRate": 44,
41 "salaryGapPct": 18,
42 "reviewCount": 3900
43 }
44 ]
45};
46
47
48const run = await client.actor("quanmatrix/glassdoor-employer-retention-risk-intelligence").call(input);
49
50
51console.log('Results from dataset');
52console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
53const { items } = await client.dataset(run.defaultDatasetId).listItems();
54items.forEach((item) => {
55 console.dir(item);
56});
57
58