Title: Provides Access to the 'OpenHolidays' API
Version: 0.1.0
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/.
License: MIT + file LICENSE
Encoding: UTF-8
Language: en
RoxygenNote: 7.3.2
Suggests: testthat (≥ 3.0.0)
Config/testthat/edition: 3
Imports: httr2
URL: https://github.com/jfeldhege/openholidaysR, http://www.johannesfeldhege.de/openholidaysR/
BugReports: https://github.com/jfeldhege/openholidaysR/issues
Depends: R (≥ 4.1)
NeedsCompilation: no
Packaged: 2025-11-19 20:31:53 UTC; Johannes
Author: Johannes Feldhege ORCID iD [aut, cre, cph]
Maintainer: Johannes Feldhege <mail@johannesfeldhege.de>
Repository: CRAN
Date/Publication: 2025-11-24 09:40:02 UTC

openholidaysR: 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/.

Author(s)

Maintainer: Johannes Feldhege mail@johannesfeldhege.de (ORCID) [copyright holder]

See Also

Useful links:


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