Learn R Programming

ChileDataAPI (version 0.1.0)

get_chile_uf: Get Unidad de Fomento (UF) from the findic.cl API

Description

This function retrieves the Unidad de Fomento (UF) daily values in Chilean Pesos from the API endpoint: https://findic.cl/api/uf. The data is provided by the Chilean website findic.cl.

Usage

get_chile_uf()

Arguments

Value

A tibble (data frame) with the following columns:

  • fecha: Fecha del valor observado (in "YYYY-MM-DD" format).

  • valor: Valor diario de la UF en pesos chilenos (numeric).

Details

The values returned by the API include metadata and a time series of daily UF values. The names of the variables and the values are in Spanish, exactly as provided by the API. For example, the result includes columns named fecha (date) and valor (value).

The function sends a GET request to the /api/uf endpoint. If the request is successful (HTTP 200), it parses the JSON response and extracts the time series data under the key serie.

All names and values are kept in Spanish as provided by the API and no translation or modification is applied.

See Also

Examples

Run this code
if (FALSE) {
uf_data <- get_chile_uf()
head(uf_data)
}

Run the code above in your browser using DataLab