Package 'openholidaysR'

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

Help Index


Get list of countries supported by OpenHolidays

Description

Get list of countries supported by OpenHolidays

Usage

oh_countries(language = "EN")

Arguments

language

Language code (default: "EN").

Value

A data frame of supported countries.

Examples

oh_countries(language = "DE")

Get supported languages

Description

This function retrieves the list of supported languages from the OpenHolidays API.

Usage

oh_languages()

Value

A data frame of available languages (ISO code + localized name).

Examples

oh_languages()

Get public holidays for a given country and time period

Description

Get public holidays for a given country and time period

Usage

oh_public_holidays(country, language = "EN", start_date, end_date)

Arguments

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).

Value

A data frame of holidays for a given country and time period.

Examples

# 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

Description

Get public holidays for a specific date for all countries

Usage

oh_public_holidays_by_date(date, language = "EN")

Arguments

date

date (YYYY-MM-DD).

language

Language ISO code (default: "EN").

Value

A data frame of holidays for all countries.

Examples

oh_public_holidays_by_date(date = "2025-12-25")

Get school holidays for a given country and time period

Description

This function retrieves school holidays from the OpenHolidays API for a specified country within a given date range.

Usage

oh_school_holidays(
  country,
  language = "EN",
  start_date,
  end_date,
  subdivision = NULL
)

Arguments

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).

Value

A data frame of school holidays.

Examples

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

Description

Get school holidays for a specific date for all countries

Usage

oh_school_holidays_by_date(date, language = "EN")

Arguments

date

date (YYYY-MM-DD).

language

Language ISO code (default: "EN").

Value

A data frame of school holidays for all countries.

Examples

oh_school_holidays_by_date(date = "2025-01-06")

Reads statistical data about stored holidays

Description

Reads statistical data about stored holidays

Usage

oh_stat_public_holidays(country, subdivision = NULL)

oh_stat_school_holidays(country, subdivision = NULL)

Arguments

country

Country ISO code (e.g., "DE").

subdivision

Optional subdivision ID (if you want holidays for a specific state/province).

Value

A data frame containing youngestStartDate and oldestStartDate.

Examples

# 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")

Get subdivisions for a given country

Description

This function retrieves administrative subdivisions (e.g., states, provinces) for a specified country from the OpenHolidays API.

Usage

oh_subdivisions(country, language = "EN")

Arguments

country

Country ISO code (e.g., "DE" for Germany).

language

Language code (default: "EN").

Value

A data frame of subdivisions.

Examples

oh_subdivisions(country = "DE")