Skip to main content

Queries

Pro Feature

The Programmatic API requires Prisma Calendar Pro.

getEvents(input)

Returns events in a date range (including virtual recurring instances).

Input:

PropertyTypeRequiredDescription
startstringyesISO datetime for range start
endstringyesISO datetime for range end
calendarIdstringnoTarget calendar ID

Returns: Promise<PrismaEventOutput[]>

Example:

const events = await window.PrismaCalendar.getEvents({
start: "2026-02-24T00:00:00",
end: "2026-03-01T00:00:00"
});
console.log(`Found ${events.length} events this week`);

getEventByPath(input)

Looks up a single event by file path (checks both tracked and untracked events).

Input:

PropertyTypeRequiredDescription
filePathstringyesPath to the event file
calendarIdstringnoTarget calendar ID

Returns: PrismaEventOutput | null

Example:

const event = window.PrismaCalendar.getEventByPath({
filePath: "Calendar/260224090000 Team Meeting.md"
});
if (event) console.log(event.title, event.start);

getAllEvents(input?)

Returns all tracked and untracked events in the calendar.

Input:

PropertyTypeRequiredDescription
calendarIdstringnoTarget calendar ID

Returns: PrismaEventOutput[]

Example:

const all = window.PrismaCalendar.getAllEvents();
console.log(`Total events: ${all.length}`);

getCategories(input?)

Returns all categories with their resolved colors.

Input:

PropertyTypeRequiredDescription
calendarIdstringnoTarget calendar ID

Returns: PrismaCategoryOutput[] — each with name and color.

Example:

const categories = window.PrismaCalendar.getCategories();
categories.forEach(c => console.log(`${c.name}: ${c.color}`));

getUntrackedEvents(input?)

Returns only untracked events (events without date properties).

Input:

PropertyTypeRequiredDescription
calendarIdstringnoTarget calendar ID

Returns: PrismaEventOutput[]

Example:

const untracked = window.PrismaCalendar.getUntrackedEvents();
console.log(`${untracked.length} events without dates`);

Event output shape

All query methods return events in this shape:

PropertyTypeDescription
filePathstringPath to the event file
titlestringEvent name
type"timed" | "allDay" | "untracked"Event type
startstring?ISO start datetime
endstring?ISO end datetime (timed only)
allDaybooleanWhether it's an all-day event
isVirtualbooleanWhether it's a virtual recurring instance
skippedbooleanWhether the event is skipped
colorstring?Resolved color
categoriesstring[]?Category values
locationstring?Location
participantsstring[]?Participants
statusstring?Status value (e.g., done/undone)
iconstring?Event icon
rruleTypestring?Recurrence rule type
rruleIdstring?Recurrence rule ID
instanceDatestring?Instance date for recurring events