MyNixOS website logo
Description

Access Chilean Data via APIs and Curated Datasets.

Provides functions to access data from public RESTful APIs including 'FINDIC API', 'REST Countries API', 'World Bank API', and 'Nager.Date', retrieving real-time or historical data related to Chile such as financial indicators, holidays, international demographic and geopolitical indicators, and more. Additionally, the package includes curated datasets related to Chile, covering topics such as human rights violations during the Pinochet regime, electoral data, census samples, health surveys, seismic events, territorial codes, and environmental measurements. The package supports research and analysis focused on Chile by integrating open APIs with high-quality datasets from multiple domains. For more information on the APIs, see: 'FINDIC' <https://findic.cl/>, 'REST Countries' <https://restcountries.com/>, 'World Bank API' <https://datahelpdesk.worldbank.org/knowledgebase/articles/889392>, and 'Nager.Date' <https://date.nager.at/Api>.

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

  • 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_cl(): Get essential information about Chile or any other country by its full name

  • get_chile_holidays(): Get official public holidays in chile for a given year, e.g., get_chile_holidays(2025).

  • get_chile_child_mortality(): Get Chile’s Under-5 Mortality Rate data from the World Bank.

  • get_chile_cpi(): Get Chile’s Consumer Price Index (2010 = 100) data from the World Bank.

  • get_chile_energy_use(): Get Chile’s Energy Use (kg of oil equivalent per capita) data from the World Bank.

  • get_chile_gdp(): Get Chile’s GDP (current US$) data from the World Bank.

  • get_chile_hospital_beds(): Get Chile’s Hospital Beds (per 1,000 people) data from the World Bank.

  • get_chile_life_expectancy(): Get Chile’s Life Expectancy at Birth data from the World Bank.

  • get_chile_literacy_rate(): Get Chile’s Adult Literacy Rate data from the World Bank.

  • get_chile_population(): Get Chile’s Total Population data from the World Bank.

  • get_chile_unemployment(): Get Chile’s Total Unemployment Rate data from the World Bank.

  • 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_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)

Metadata

Version

0.2.0

License

Unknown

Platforms (76)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows