1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "sources": [
12 {
13 "sourceId": "operations-calendar",
14 "fileName": "operations.ics",
15 "mediaType": "text/calendar",
16 "encoding": "utf8",
17 "content": "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Example Corp//Operations//EN\r\nBEGIN:VEVENT\r\nUID:maintenance-42@example.com\r\nDTSTAMP:20260901T090000Z\r\nDTSTART:20261005T090000Z\r\nDTEND:20261005T100000Z\r\nRRULE:FREQ=WEEKLY;COUNT=2\r\nSUMMARY:Maintenance review\r\nLOCATION:Operations room\r\nSTATUS:CONFIRMED\r\nSEQUENCE:1\r\nORGANIZER;CN=Ops Lead:mailto:ops-lead@example.com\r\nEND:VEVENT\r\nBEGIN:VEVENT\r\nUID:offsite-7@example.com\r\nDTSTAMP:20260901T090000Z\r\nDTSTART;VALUE=DATE:20261020\r\nDTEND;VALUE=DATE:20261021\r\nSUMMARY:Team offsite\r\nDESCRIPTION:Quarterly planning - bring your badge\r\nTRANSP:TRANSPARENT\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n"
18 }
19 ],
20 "dateWindow": {
21 "start": "2026-10-01T00:00:00Z",
22 "end": "2026-11-01T00:00:00Z"
23 },
24 "targetTimeZone": "Europe/London",
25 "deduplication": {
26 "enabled": true,
27 "mode": "uid_or_fingerprint"
28 },
29 "conflictDetection": {
30 "enabled": true,
31 "includeTransparentEvents": false
32 },
33 "limits": {
34 "maxInstances": 100,
35 "maxSourceBytes": 10485760
36 }
37};
38
39
40const run = await client.actor("first_watch/ical-calendar-feed-parsing").call(input);
41
42
43console.log('Results from dataset');
44console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
45const { items } = await client.dataset(run.defaultDatasetId).listItems();
46items.forEach((item) => {
47 console.dir(item);
48});
49
50