Learn R Programming

ChileDataAPI

The ChileDataAPI package provides a unified interface to access open data from the FINDIC API and the REST Countries API, with a focus on Chile. It allows users to easily retrieve up-to-date time series data on financial indicators such as the UF, UTM, Dollar, Euro, Yen, Copper price per pound, Bitcoin, and the IPSA index, as well as international metadata on countries via standardized API calls.

All API-based functions return data as tidy tibble objects, making them ready for immediate use in data pipelines. The financial indicator functions, such as get_chile_dollar(), get_chile_uf(), and get_chile_bitcoin(), provide real-time series of daily or monthly values, with each row representing a timestamped observation. This makes ChileDataAPI a valuable tool for working with economic time series data in a reproducible manner.

Installation

You can install the ChileDataAPI package from CRAN with the following R function:


install.packages("ChileDataAPI")

Usage

After installation, load the package and start exploring and using its functions and datasets.


library(ChileDataAPI)

ChileDataAPI Functions

  • get_chile_bitcoin(): Retrieves the daily Bitcoin price in Chilean Pesos over the last month.

  • get_chile_copper_pound(): Returns historical daily copper prices (per pound).

  • get_chile_dollar(): Provides the exchange rate of the U.S. Dollar in CLP.

  • get_chile_euro(): Provides the exchange rate of the Euro in CLP.

  • get_chile_ipsa(): Retrieves daily values of the IPSA (Chile's stock market index).

  • get_chile_uf(): Returns daily values of the Unidad de Fomento (UF).

  • get_chile_utm(): Returns monthly values of the Unidad Tributaria Mensual (UTM).

  • get_chile_yen(): Provides the exchange rate of the Japanese Yen in CLP.

  • get_country_info(name): Get essential information about Chile or any other country by its full name

Example: get_country_info("Chile"),get_country_info("chile"),get_country_info("Peru")

  • view_datasets_ChileDataAPI(): Lists all curated datasets included in the ChileDataAPI package

Dataset Suffixes

Each dataset in ChileDataAPI is labeled with a suffix to indicate its structure and type:

  • _df: A standard data frame.

  • _ts: A time series object.

  • _tbl_df: A tibble data frame object.

Datasets Included in ChileDataAPI

In addition to API access functions, ChileDataAPI provides several curated datasets offering valuable insights into Chile’s recent history, population health, territorial divisions, electoral processes, and seismic activity. Here are some featured examples:

  • census_chile_2017_df: Data frame containing microdata from the 2017 Chilean census, specifically from the commune of San Pablo. The dataset includes 7,512 observations, all variable names and data values are in Spanish.

  • chile_earthquakes_tbl_df: Tibble containing information about significant (perceptible) earthquakes

that occurred in Chile from January 1st, 2012 to the present.

  • malleco_tree_rings_ts: Time series object (ts) containing the average annual tree ring width,

measured in millimeters, for Araucaria Araucana trees located in the Malleco region of Chile.

Example Code:


# Load the package

library(ChileDataAPI)

# Selected, essential information about Chile

get_country_info("Chile")

# Provides the exchange rate of the U.S. Dollar in CLP

get_chile_dollar()

# Load a dataset

data("census_chile_2017_df")

# Shows six rows of the dataset

head(census_chile_2017_df)

# Display the structure of the dataset

str(census_chile_2017_df)

# Shows the whole dataset

View(census_chile_2017_df)

Copy Link

Version

Install

install.packages('ChileDataAPI')

Version

0.1.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Renzo Caceres Rossi

Last Published

July 16th, 2025

Functions in ChileDataAPI (0.1.0)

chile_plebiscite_df

Voting Intentions in the 1988 Chilean Plebiscite
view_datasets_ChileDataAPI

View Available Datasets in ChileDataAPI
get_country_info

Get Key Country Information from the REST Countries API
malleco_tree_rings_ts

Average Araucaria Araucana Tree Ring Width
chile_earthquakes_tbl_df

Chilean Earthquakes Data
ChileDataAPI

ChileDataAPI: Access Chilean Data via APIs and Curated Datasets
chile_health_survey_df

Chilean National Health Survey (2016–2017)
get_chile_bitcoin

Get Observed Bitcoin Value from the findic.cl API
get_chile_copper_pound

Get Observed Copper Price per Pound from the findic.cl API
get_chile_dollar

Get Observed Dollar Exchange Rate from the findic.cl API
get_chile_euro

Get Observed Euro Exchange Rate from the findic.cl API
chile_election_2021_df

Chilean 2021 First Round Presidential Election
census_chile_2017_df

Chilean Census Example Data (San Pablo Commune, 2017)
pinochet_regime_df

Human Rights Abuses in the Pinochet Regime (1973–1990)
territorial_codes_tbl_df

Official Codes for Chilean Communes, Provinces, and Regions
get_chile_utm

Get Monthly Tax Unit (UTM) from the findic.cl API
get_chile_yen

Get Observed Yen Exchange Rate from the findic.cl API
get_chile_ipsa

Get IPSA (Índice de Precios Selectivo de Acciones) from the findic.cl API
get_chile_uf

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