ChileDataAPI

The ChileDataAPI package provides a unified interface to access open data from multiple public RESTful APIs, including the FINDIC API, the REST Countries API, the World Bank API, and Nager.Date. With a focus on Chile, the package enables users to retrieve real-time or historical data such as financial indicators (UF, UTM, Dollar, Euro, Yen, Copper price per pound, Bitcoin, IPSA index), holidays, and international demographic and geopolitical information.

In addition to API-based data retrieval, ChileDataAPI includes a curated collection of datasets that cover diverse aspects of Chilean society and environment, such as human rights violations during the Pinochet regime, electoral data, census samples, health surveys, seismic events, territorial codes, and environmental measurements.

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

Dataset Suffixes

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

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:

Example Code:


# Load the package

library(ChileDataAPI)

# Selected, essential information about Chile

get_country_info_cl()

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