get_argentinian_holidays {ArgentinAPI} | R Documentation |
Get Official Holidays in Argentina for a Given Year
Description
This function retrieves the list of official holidays in Argentina for a specified year. The data is obtained from the public API at https://api.argentinadatos.com/v1/feriados/. You can append the desired year at the end of the URL. For example: https://api.argentinadatos.com/v1/feriados/2024/ If no year is provided, the function returns holidays for the current year.
Usage
get_argentinian_holidays(year = NULL)
Arguments
year |
An integer representing the year (between 2016 and 2025). Defaults to the current year. |
Details
The function sends a GET request to the ArgentinaDatos API and converts the JSON response into a structured
data frame. It validates the input year and falls back to the current year if none is specified.
If the API does not return a 200 status code, the function will return NULL
and emit a message.
Value
A data frame with the following columns:
-
fecha
: Date of the holiday (character in YYYY-MM-DD format). -
tipo
: Type of holiday (e.g., "inamovible", "trasladable"). -
nombre
: Name or reason of the holiday.
Note
Requires an active internet connection. If the API is unavailable or its structure changes, the function may need updates.
See Also
Examples
## Not run:
# Get holidays for the year 2025
feriados_2025 <- get_argentinian_holidays(2025)
print(feriados_2025)
# Get holidays for the current year
feriados_actual <- get_argentinian_holidays()
View(feriados_actual)
## End(Not run)