API reference

Operations, return types, and errors in each language.

Operations

OperationJavaTypeScriptPython
List a year's holidaysgetHolidays(year[, order])getHolidays(year[, order])get_holidays(year[, order])
List a month's holidaysgetHolidaysForMonth(year, month[, order])getHolidaysForMonth(year, month[, order])get_holidays_for_month(year, month[, order])
Get a day's holiday objectgetHoliday(LocalDate) / getHoliday(year, month, day)getHoliday("YYYY-MM-DD") / getHoliday(year, month, day)get_holiday(date) / get_holiday(year, month, day)
Check whether the day is a holidayisHoliday(LocalDate)isHoliday("YYYY-MM-DD")is_holiday(date)

In Java, the operations are static methods of jp.kurashina.japanholidays.Holidays. Python's get_holiday and is_holiday take positional arguments only.

Return types

ResultJavaTypeScriptPython
Year and month listingsList<Holiday>readonly Holiday[]tuple[Holiday, ...]
Daily lookupOptional<Holiday>Holiday | nullOptional[Holiday]
Holiday checkbooleanbooleanbool

Listings are read-only. For an ordinary day in a covered year, the check returns false, and the daily lookup returns Optional.empty() in Java, null in TypeScript, and None in Python.

Errors

CaseJavaTypeScriptPython
Argument of the wrong typeNullPointerException for nullTypeErrorTypeError
Invalid value of the right typeIllegalArgumentExceptionRangeErrorValueError

Wrong types include a Date object in TypeScript, and a string or datetime in Python. Invalid values include February 30, month 13, an unknown order, and a year outside the coverage. Java date construction, such as LocalDate.of(2026, 2, 30), may throw before calling Japan Holidays.

Dates

Dates use the Gregorian calendar without local time zone conversion. Java uses LocalDate, Python uses datetime.date, and TypeScript uses YYYY-MM-DD strings.

Searching by Japanese era input is deferred for the initial release. Searches accept Gregorian dates, and results include the Japanese era display date.