# JSON and CSV Event Data to Subscribable ICS Feed Publisher (`kingii98/json-and-csv-event-data-to-subscribable-ics-feed-publisher`) Actor

Turn JSON or CSV event rows into a subscribable ICS feed with stable UIDs and SEQUENCE.

- **URL**: https://apify.com/kingii98/json-and-csv-event-data-to-subscribable-ics-feed-publisher.md
- **Developed by:** [kingii98](https://apify.com/kingii98) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 calendar publisheds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## JSON and CSV Event Data to Subscribable ICS Feed Publisher

This Actor turns a list of events into an RFC 5545 ICS feed. People can subscribe to the feed in a calendar app.

The Actor keeps each event UID stable. It increases SEQUENCE only when an event really changes. Calendar apps then update the event and do not duplicate it.

### Input

| Field | Description |
| --- | --- |
| `sourceUrl` | Public HTTPS URL of a JSON array or CSV file. Maximum 5 MB and 2,000 events. |
| `events` | Inline JSON array of event objects. Maximum 2,000 events. The Actor uses it when `sourceUrl` is empty. |
| `fieldMap` | Maps event fields to your column names. Keys: `title`, `start`, `end`, `allDay`, `location`, `description`, `url`, `id`. |
| `defaultTimeZone` | IANA time zone for times that have no offset. Default: `UTC`. |
| `calendarName` | Calendar name. Default: `Events`. |
| `storeName` | Named key-value store for the feed. Use the same name on each run. Default: `ics-feed-publisher`. |

Every field has a default. A run with empty input succeeds. It publishes two sample events.

#### Time rules

- A date such as `2026-11-14` gives an all-day event. The `end` date of an all-day event is inclusive.
- A date-time without an offset uses `defaultTimeZone`. The feed stores times in UTC.
- A missing end gives a default end (1 hour, or 1 day for all-day events).

### Output

- **Key-value store** (`storeName`): `calendar.ics` is the feed. `STATE` holds the map of source id to UID, content hash, and SEQUENCE.
- **Dataset**: one row per event with `uid`, `status`, `sequence`, and `warnings`. One `summary` row has the counts and the `subscriptionUrl`.

Status values:

- `new`: the event is not in the saved state.
- `updated`: the content changed. SEQUENCE increased by 1.
- `unchanged`: no change. UID and SEQUENCE stay the same.
- `removed`: the event left the source. The feed keeps it as `STATUS:CANCELLED` with a higher SEQUENCE.
- `skipped`: the event is not valid or has a duplicate id. The Actor does not put it in the feed.

Warnings: `missing end`, `end before start`, `invalid time zone`, `invalid end`, `missing title`.

The event `id` field gives the stable identity. If a row has no id, the Actor uses a hash of title and start. A changed title or start then looks like a new event. Use an `id` column when you can.

### Subscribe

Copy `subscriptionUrl` from the summary row into your calendar app. Anyone who has the URL can read the feed. Do not put private data in it.

### Pricing (pay-per-event)

| Event | When the Actor charges | Price |
| --- | --- | --- |
| `calendar-published` | Once per run, after the ICS file is written to the key-value store. | $0.01 |
| `event-written` | Once for each valid event that the Actor writes to the feed. Skipped events and cancelled events do not count. | $0.0002 |

A run with a bad input or an unreachable source publishes no feed. The Actor does not charge for that run. The run still succeeds. The summary row shows `status: "error"` and the reason.

### Safety limits

- HTTP only. The Actor uses no browser, proxy, or paid API.
- HTTPS on port 443 only. No credentials in the URL.
- The Actor rejects private, loopback, link-local, and other reserved addresses. It checks each redirect.
- Maximum 3 redirects, 5 MB, and 2,000 events. Each network read can take 20 seconds. The whole fetch can take 30 seconds.
- Limit: the Actor checks the address before the request. It cannot fully stop DNS rebinding between the check and the request.

### Development

```
uv run pytest
uv run ruff check .
```

# Actor input Schema

## `sourceUrl` (type: `string`):

Public HTTPS URL of a JSON array or CSV file. Maximum 5 MB and 2,000 events. Leave empty to use the inline events.

## `events` (type: `array`):

Inline JSON array of event objects. Maximum 2,000 events. The Actor ignores this field when Source URL is set.

## `fieldMap` (type: `object`):

Maps event fields to source column names. Keys: title, start, end, allDay, location, description, url, id.

## `defaultTimeZone` (type: `string`):

IANA time zone for start and end times that have no offset. Example: Europe/Berlin.

## `calendarName` (type: `string`):

Name that calendar apps show for the feed.

## `storeName` (type: `string`):

Named key-value store for the ICS file (calendar.ics) and the saved state (STATE). Use 3-63 lowercase letters, digits, or hyphens. Use the same name on each run to keep UIDs stable.

## Actor input object example

```json
{
  "events": [
    {
      "id": "sample-1",
      "title": "Club meeting",
      "start": "2026-11-05T18:30:00",
      "end": "2026-11-05T20:00:00",
      "location": "Main hall",
      "description": "Monthly meeting."
    },
    {
      "id": "sample-2",
      "title": "Open day",
      "start": "2026-11-14",
      "end": "2026-11-15"
    }
  ],
  "fieldMap": {
    "title": "title",
    "start": "start",
    "end": "end",
    "allDay": "allDay",
    "location": "location",
    "description": "description",
    "url": "url",
    "id": "id"
  },
  "defaultTimeZone": "UTC",
  "calendarName": "Events",
  "storeName": "ics-feed-publisher"
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "events": [
        {
            "id": "sample-1",
            "title": "Club meeting",
            "start": "2026-11-05T18:30:00",
            "end": "2026-11-05T20:00:00",
            "location": "Main hall",
            "description": "Monthly meeting."
        },
        {
            "id": "sample-2",
            "title": "Open day",
            "start": "2026-11-14",
            "end": "2026-11-15"
        }
    ],
    "fieldMap": {
        "title": "title",
        "start": "start",
        "end": "end",
        "allDay": "allDay",
        "location": "location",
        "description": "description",
        "url": "url",
        "id": "id"
    },
    "defaultTimeZone": "UTC",
    "calendarName": "Events",
    "storeName": "ics-feed-publisher"
};

// Run the Actor and wait for it to finish
const run = await client.actor("kingii98/json-and-csv-event-data-to-subscribable-ics-feed-publisher").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "events": [
        {
            "id": "sample-1",
            "title": "Club meeting",
            "start": "2026-11-05T18:30:00",
            "end": "2026-11-05T20:00:00",
            "location": "Main hall",
            "description": "Monthly meeting.",
        },
        {
            "id": "sample-2",
            "title": "Open day",
            "start": "2026-11-14",
            "end": "2026-11-15",
        },
    ],
    "fieldMap": {
        "title": "title",
        "start": "start",
        "end": "end",
        "allDay": "allDay",
        "location": "location",
        "description": "description",
        "url": "url",
        "id": "id",
    },
    "defaultTimeZone": "UTC",
    "calendarName": "Events",
    "storeName": "ics-feed-publisher",
}

# Run the Actor and wait for it to finish
run = client.actor("kingii98/json-and-csv-event-data-to-subscribable-ics-feed-publisher").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "events": [
    {
      "id": "sample-1",
      "title": "Club meeting",
      "start": "2026-11-05T18:30:00",
      "end": "2026-11-05T20:00:00",
      "location": "Main hall",
      "description": "Monthly meeting."
    },
    {
      "id": "sample-2",
      "title": "Open day",
      "start": "2026-11-14",
      "end": "2026-11-15"
    }
  ],
  "fieldMap": {
    "title": "title",
    "start": "start",
    "end": "end",
    "allDay": "allDay",
    "location": "location",
    "description": "description",
    "url": "url",
    "id": "id"
  },
  "defaultTimeZone": "UTC",
  "calendarName": "Events",
  "storeName": "ics-feed-publisher"
}' |
apify call kingii98/json-and-csv-event-data-to-subscribable-ics-feed-publisher --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kingii98/json-and-csv-event-data-to-subscribable-ics-feed-publisher"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/mS28rApMZQo42Ph1R/builds/zzYNNiPAVhdB9P4wn/openapi.json
