1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "insuranceInventoryFile": {
12 "rows": [
13 {
14 "contractor_id": "C1",
15 "policy_record_id": "R1",
16 "coverage_type": "general_liability",
17 "effective_date": "2026-01-01",
18 "expiration_date": "2026-12-31",
19 "occurrence_limit": "1000000",
20 "aggregate_limit": "2000000",
21 "currency": "USD",
22 "policy_number": "DEMO-123456"
23 },
24 {
25 "contractor_id": "C2",
26 "policy_record_id": "R2",
27 "coverage_type": "general_liability",
28 "effective_date": "2026-01-01",
29 "expiration_date": "2026-11-14",
30 "occurrence_limit": "500000",
31 "aggregate_limit": "2000000",
32 "currency": "USD",
33 "policy_number": "DEMO-123456"
34 },
35 {
36 "contractor_id": "C3",
37 "policy_record_id": "R3",
38 "coverage_type": "general_liability",
39 "effective_date": "2026-12-01",
40 "expiration_date": "2026-12-31",
41 "occurrence_limit": "1000000",
42 "aggregate_limit": "2000000",
43 "currency": "EUR",
44 "policy_number": "DEMO-123456"
45 },
46 {
47 "contractor_id": "C4",
48 "policy_record_id": "R4",
49 "coverage_type": "general_liability",
50 "effective_date": "2026-01-01",
51 "expiration_date": "2026-10-31",
52 "occurrence_limit": "1000000",
53 "aggregate_limit": "2000000",
54 "currency": "USD",
55 "policy_number": "DEMO-123456"
56 },
57 {
58 "contractor_id": "C5",
59 "policy_record_id": "R5",
60 "coverage_type": "general_liability",
61 "effective_date": "2026-01-01",
62 "expiration_date": null,
63 "occurrence_limit": "1000000",
64 "aggregate_limit": "2000000",
65 "currency": "USD",
66 "policy_number": "DEMO-123456"
67 }
68 ]
69 },
70 "contractorRequirementsFile": {
71 "rows": [
72 {
73 "contractor_id": "C1",
74 "coverage_type": "general_liability",
75 "occurrence_limit": "1000000",
76 "aggregate_limit": "2000000",
77 "currency": "USD"
78 },
79 {
80 "contractor_id": "C2",
81 "coverage_type": "general_liability",
82 "occurrence_limit": "1000000",
83 "aggregate_limit": "2000000",
84 "currency": "USD"
85 },
86 {
87 "contractor_id": "C3",
88 "coverage_type": "general_liability",
89 "occurrence_limit": "1000000",
90 "aggregate_limit": "2000000",
91 "currency": "USD"
92 },
93 {
94 "contractor_id": "C4",
95 "coverage_type": "general_liability",
96 "occurrence_limit": "1000000",
97 "aggregate_limit": "2000000",
98 "currency": "USD"
99 },
100 {
101 "contractor_id": "C5",
102 "coverage_type": "general_liability",
103 "occurrence_limit": "1000000",
104 "aggregate_limit": "2000000",
105 "currency": "USD"
106 }
107 ]
108 },
109 "asOfDate": "2026-11-14"
110};
111
112
113const run = await client.actor("afkdigital/contractor-insurance-expiry-checker").call(input);
114
115
116console.log('Results from dataset');
117console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
118const { items } = await client.dataset(run.defaultDatasetId).listItems();
119items.forEach((item) => {
120 console.dir(item);
121});
122
123