| Title: | Provides Access to the 'OpenHolidays' API |
|---|---|
| Description: | Provides dates for public and school holidays for a number of countries and their subdivisions through the 'OpenHolidays' API at <https://www.openholidaysapi.org/en/>. |
| Authors: | Johannes Feldhege [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-4665-5235>) |
| Maintainer: | Johannes Feldhege <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-05-12 07:48:14 UTC |
| Source: | https://github.com/jfeldhege/openholidaysr |
Get list of countries supported by OpenHolidays
oh_countries(language = "EN")oh_countries(language = "EN")
language |
Language code (default: "EN"). |
A data frame of supported countries.
oh_countries(language = "DE")oh_countries(language = "DE")
This function retrieves the list of supported languages from the OpenHolidays API.
oh_languages()oh_languages()
A data frame of available languages (ISO code + localized name).
oh_languages()oh_languages()
Get public holidays for a given country and time period
oh_public_holidays(country, language = "EN", start_date, end_date)oh_public_holidays(country, language = "EN", start_date, end_date)
country |
Country ISO code (e.g. "DE" for Germany). |
language |
Language ISO code (default: "EN"). |
start_date |
Start date of time period (YYYY-MM-DD). |
end_date |
End date of time period (YYYY-MM-DD). |
A data frame of holidays for a given country and time period.
# Get all holidays for Germany for the year 2025 oh_public_holidays(country = "DE", language = "EN", start_date = "2025-01-01", end_date = "2025-12-31")# Get all holidays for Germany for the year 2025 oh_public_holidays(country = "DE", language = "EN", start_date = "2025-01-01", end_date = "2025-12-31")
Get public holidays for a specific date for all countries
oh_public_holidays_by_date(date, language = "EN")oh_public_holidays_by_date(date, language = "EN")
date |
date (YYYY-MM-DD). |
language |
Language ISO code (default: "EN"). |
A data frame of holidays for all countries.
oh_public_holidays_by_date(date = "2025-12-25")oh_public_holidays_by_date(date = "2025-12-25")
This function retrieves school holidays from the OpenHolidays API for a specified country within a given date range.
oh_school_holidays( country, language = "EN", start_date, end_date, subdivision = NULL )oh_school_holidays( country, language = "EN", start_date, end_date, subdivision = NULL )
country |
Country ISO code (e.g., "DE"). |
language |
Language code (default: "EN"). |
start_date |
Start date in YYYY-MM-DD format. |
end_date |
End date in YYYY-MM-DD format. |
subdivision |
Optional subdivision ID (if you want holidays for a specific subdivision such as state/province). |
A data frame of school holidays.
oh_school_holidays(country = "DE", start_date = "2025-01-01", end_date = "2025-01-31") oh_school_holidays(country = "DE", start_date = "2025-01-01", end_date = "2025-01-31", subdivision = "DE-BY")oh_school_holidays(country = "DE", start_date = "2025-01-01", end_date = "2025-01-31") oh_school_holidays(country = "DE", start_date = "2025-01-01", end_date = "2025-01-31", subdivision = "DE-BY")
Get school holidays for a specific date for all countries
oh_school_holidays_by_date(date, language = "EN")oh_school_holidays_by_date(date, language = "EN")
date |
date (YYYY-MM-DD). |
language |
Language ISO code (default: "EN"). |
A data frame of school holidays for all countries.
oh_school_holidays_by_date(date = "2025-01-06")oh_school_holidays_by_date(date = "2025-01-06")
Reads statistical data about stored holidays
oh_stat_public_holidays(country, subdivision = NULL) oh_stat_school_holidays(country, subdivision = NULL)oh_stat_public_holidays(country, subdivision = NULL) oh_stat_school_holidays(country, subdivision = NULL)
country |
Country ISO code (e.g., "DE"). |
subdivision |
Optional subdivision ID (if you want holidays for a specific state/province). |
A data frame containing youngestStartDate and oldestStartDate.
# Statistical data about public holidays in Germany oh_stat_public_holidays(country = "DE") # Statistical data about school holidays in Hamburg oh_stat_school_holidays(country = "DE", subdivision = "DE-HH")# Statistical data about public holidays in Germany oh_stat_public_holidays(country = "DE") # Statistical data about school holidays in Hamburg oh_stat_school_holidays(country = "DE", subdivision = "DE-HH")
This function retrieves administrative subdivisions (e.g., states, provinces) for a specified country from the OpenHolidays API.
oh_subdivisions(country, language = "EN")oh_subdivisions(country, language = "EN")
country |
Country ISO code (e.g., "DE" for Germany). |
language |
Language code (default: "EN"). |
A data frame of subdivisions.
oh_subdivisions(country = "DE")oh_subdivisions(country = "DE")