iCalendar (.ics) Generator API
Create .ics calendar files for Google, Apple and Outlook: events, all-day events, recurrence, reminders, and yearly events on a lunar date (giỗ, rằm) expanded to solar dates.
The ICS API builds iCalendar files (RFC 5545) that every calendar app imports: Google Calendar, Apple Calendar, Outlook, Thunderbird. Send one event as parameters or many as a JSON events array, each with a title, start (YYYY-MM-DDTHH:MM in Vietnam time, or a date for all-day events), end or duration_minutes, location, description, URL, recurrence rule (rrule, e.g. FREQ=WEEKLY;COUNT=10) and reminders (alarm_minutes). Text is escaped and long lines folded as the standard requires, and a VTIMEZONE for Asia/Ho_Chi_Minh is included.
Standard calendars cannot repeat an event on a lunar date. With lunar: { day: 10, month: 3, years: 10 } the API computes the solar date of that lunar date for each year (10/3 âm lịch → 26/4/2026, 16/4/2027…) and writes one event per year: death anniversaries (giỗ), rằm and mùng 1, lunar birthdays, Hung Kings Day. A day 30 in a 29-day month falls on the last day of the month.
The response is a downloadable .ics file; format=json returns the file content and the list of computed dates instead.
Parameters
| Name | In | Type | Required | Default | |
|---|---|---|---|---|---|
events | body | array | no | Events: {title, start, end, duration_minutes, all_day, location, description, url, rrule, alarm_minutes, lunar}. | |
title | body|query | string | no | Single event: title (with start or lunar). | |
start | body|query | string | no | YYYY-MM-DD or YYYY-MM-DDTHH:MM (Vietnam time). | |
lunar | query | string | no | Single event on a lunar date DD/MM, with years and from_year. | |
name | body|query | string | no | Calendar name. | |
format | body|query | string | no | ics | ics (file) or json. |
Example
curl -X POST "https://apibox.io.vn/v1/ics" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Lịch gia đình","format":"json","events":[{"title":"Giỗ ông nội","lunar":{"day":10,"month":3,"years":3,"from_year":2026},"all_day":true,"alarm_minutes":1440}]}'const res = await fetch('https://apibox.io.vn/v1/ics', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "Lịch gia đình",
"format": "json",
"events": [
{
"title": "Giỗ ông nội",
"lunar": {
"day": 10,
"month": 3,
"years": 3,
"from_year": 2026
},
"all_day": true,
"alarm_minutes": 1440
}
]
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://apibox.io.vn/v1/ics",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"name": "Lịch gia đình", "format": "json", "events": [{"title": "Giỗ ông nội", "lunar": {"day": 10, "month": 3, "years": 3, "from_year": 2026}, "all_day": True, "alarm_minutes": 1440}]},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/ics');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"name":"Lịch gia đình","format":"json","events":[{"title":"Giỗ ông nội","lunar":{"day":10,"month":3,"years":3,"from_year":2026},"all_day":true,"alarm_minutes":1440}]}',
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));Response
{
"events": 3,
"occurrences": [
{
"title": "Giỗ ông nội",
"date": "2026-04-26"
},
{
"title": "Giỗ ông nội",
"date": "2027-04-16"
},
{
"title": "Giỗ ông nội",
"date": "2028-04-04"
}
],
"ics": "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//APIBox//ics//VI\r\n…"
}
Use cases
- “Add to calendar” buttons for bookings, webinars and events
- Family calendars of death anniversaries and rằm on lunar dates
- Export schedules from HR, school and booking systems
- Recurring reminders for subscriptions and deadlines
FAQ
How do I repeat an event every lunar year?
Use lunar: { day, month, years, from_year }. Calendar apps have no lunar recurrence, so the API writes one event per year with the right solar date.
Which time zone is used?
Times are Vietnam time (Asia/Ho_Chi_Minh, UTC+7); the file includes the time zone definition so apps abroad show the right local time.
Can I add reminders?
Yes, alarm_minutes (a number or an array of up to 5) adds display alarms before the event.
Related APIs
UUID Generator
Generate up to 1,000 UUID v4, time-ordered UUID v7, ULID, Nano ID or random hex IDs per request. Secure randomness, optional uppercase.
⏱Cron Expression Parser
Validate a cron expression and get its next run times in any timezone, with a plain-English description. Supports 5, 6 and 7-field cron syntax.
🕒Time & Timezone Converter
Get the current time in any timezone, convert between timezones and Unix timestamps (seconds or ms), with UTC offset and weekday for up to 30 zones.