Type: Package
Title: Access Indonesian Data via Public APIs and Curated Datasets
Version: 0.1.0
Maintainer: Renzo Caceres Rossi <arenzocaceresrossi@gmail.com>
Description: Provides functions to access data from public RESTful APIs including 'Nager.Date', 'World Bank API', and 'REST Countries API', retrieving real-time or historical data related to Indonesia, such as holidays, economic indicators, and international demographic and geopolitical indicators. The package also includes a curated collection of open datasets focused on Indonesia, covering topics such as consumer prices, poverty probability, food prices by region, tourism destinations, and minimum wage statistics. The package supports reproducible research and teaching by integrating reliable international APIs and structured datasets from public, academic, and government sources. For more information on the APIs, see: 'Nager.Date' https://date.nager.at/Api, 'World Bank API' https://datahelpdesk.worldbank.org/knowledgebase/articles/889392, and 'REST Countries API' https://restcountries.com/.
License: MIT + file LICENSE
Language: en
URL: https://github.com/lightbluetitan/indonesiapis, https://lightbluetitan.github.io/indonesiapis/
BugReports: https://github.com/lightbluetitan/indonesiapis/issues
Encoding: UTF-8
LazyData: true
Depends: R (≥ 4.1.0)
Imports: utils, httr, jsonlite, dplyr, scales, tibble
Suggests: ggplot2, testthat (≥ 3.0.0), knitr, rmarkdown
RoxygenNote: 7.3.2
Config/testthat/edition: 3
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2025-09-04 14:25:27 UTC; Renzo
Author: Renzo Caceres Rossi ORCID iD [aut, cre]
Repository: CRAN
Date/Publication: 2025-09-09 14:20:07 UTC

IndonesiAPIs: Access Indonesian Data via Public APIs and Curated Datasets

Description

This package provides functions to access data from public RESTful APIs including 'Nager.Date', 'World Bank API', and 'REST Countries API', retrieving real-time or historical data related to Indonesia, such as holidays, economic indicators, and international demographic and geopolitical indicators. The package also includes a curated collection of open datasets focused on Indoesia, covering topics such as consumer prices, poverty probability, food prices by region, tourism destinations, and minimum wage statistics.

Details

IndonesiAPIs: Access Indonesian Data via Public APIs and Curated Datasets

logo

Access Indonesian Data via Public APIs and Curated Datasets.

Author(s)

Maintainer: Renzo Caceres Rossi arenzocaceresrossi@gmail.com

See Also

Useful links:


Food Prices in Bali

Description

This dataset, Bali_tbl_df, is a tibble containing food price data in Bali, Indonesia. It includes prices for various food items such as rice, chicken, beef, eggs, onions, chilies, cooking oil, and sugar, recorded over multiple observations.

Usage

data(Bali_tbl_df)

Format

A tibble with 1,043 observations and 30 variables:

Tanggal

Date of the observation (character)

Beras

Price of rice (numeric)

Beras Kualitas Medium I

Price of medium quality rice I (numeric)

Beras Kualitas Medium II

Price of medium quality rice II (numeric)

Beras Kualitas Super I

Price of super quality rice I (numeric)

Beras Kualitas Super II

Price of super quality rice II (numeric)

Daging Ayam

Price of chicken meat (numeric)

Daging Ayam Ras Segar

Price of fresh broiler chicken meat (numeric)

Daging Sapi

Price of beef (numeric)

Daging Sapi Kualitas 1

Price of quality 1 beef (numeric)

Daging Sapi Kualitas 2

Price of quality 2 beef (numeric)

Telur Ayam

Price of chicken eggs (numeric)

Telur Ayam Ras Segar

Price of fresh broiler chicken eggs (numeric)

Bawang Merah

Price of red onions (numeric)

Bawang Merah Ukuran Sedang

Price of medium-sized red onions (numeric)

Bawang Putih

Price of garlic (numeric)

Bawang Putih Ukuran Sedang

Price of medium-sized garlic (numeric)

Cabai Merah

Price of red chilies (numeric)

Cabai Merah Besar

Price of large red chilies (numeric)

Cabai Merah Keriting

Price of curly red chilies (numeric)

Cabai Rawit

Price of bird's eye chilies (numeric)

Cabai Rawit Hijau

Price of green bird's eye chilies (numeric)

Cabai Rawit Merah

Price of red bird's eye chilies (numeric)

Minyak Goreng

Price of cooking oil (numeric)

Minyak Goreng Curah

Price of bulk cooking oil (numeric)

Minyak Goreng Kemasan Bermerk 1

Price of branded packaged cooking oil 1 (numeric)

Minyak Goreng Kemasan Bermerk 2

Price of branded packaged cooking oil 2 (numeric)

Gula Pasir

Price of granulated sugar (numeric)

Gula Pasir Kualitas Premium

Price of premium granulated sugar (numeric)

Gula Pasir Lokal

Price of local granulated sugar (numeric)

Details

The dataset name has been kept as 'Bali_tbl_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the IndonesiAPIs package and assists users in identifying its specific characteristics. The suffix 'tbl_df' indicates that the dataset is a tibble object. The original content has not been modified in any way.

Source

Data taken from the ifpd package version 0.1.0


Food Prices in DKI Jakarta

Description

This dataset, DKIJakarta_tbl_df, is a tibble containing food price data in DKI Jakarta, Indonesia. It includes prices for various food items such as rice, chicken, beef, eggs, onions, chilies, cooking oil, and sugar, recorded over multiple observations.

Usage

data(DKIJakarta_tbl_df)

Format

A tibble with 1,043 observations and 32 variables:

Tanggal

Date of the observation (character)

Beras

Price of rice (numeric)

Beras Kualitas Bawah I

Price of low quality rice I (numeric)

Beras Kualitas Bawah II

Price of low quality rice II (numeric)

Beras Kualitas Medium I

Price of medium quality rice I (numeric)

Beras Kualitas Medium II

Price of medium quality rice II (numeric)

Beras Kualitas Super I

Price of super quality rice I (numeric)

Beras Kualitas Super II

Price of super quality rice II (numeric)

Daging Ayam

Price of chicken meat (numeric)

Daging Ayam Ras Segar

Price of fresh broiler chicken meat (numeric)

Daging Sapi

Price of beef (numeric)

Daging Sapi Kualitas 1

Price of quality 1 beef (numeric)

Daging Sapi Kualitas 2

Price of quality 2 beef (numeric)

Telur Ayam

Price of chicken eggs (numeric)

Telur Ayam Ras Segar

Price of fresh broiler chicken eggs (numeric)

Bawang Merah

Price of red onions (numeric)

Bawang Merah Ukuran Sedang

Price of medium-sized red onions (numeric)

Bawang Putih

Price of garlic (numeric)

Bawang Putih Ukuran Sedang

Price of medium-sized garlic (numeric)

Cabai Merah

Price of red chilies (numeric)

Cabai Merah Besar

Price of large red chilies (numeric)

Cabai Merah Keriting

Price of curly red chilies (numeric)

Cabai Rawit

Price of bird's eye chilies (numeric)

Cabai Rawit Hijau

Price of green bird's eye chilies (numeric)

Cabai Rawit Merah

Price of red bird's eye chilies (numeric)

Minyak Goreng

Price of cooking oil (numeric)

Minyak Goreng Curah

Price of bulk cooking oil (numeric)

Minyak Goreng Kemasan Bermerk 1

Price of branded packaged cooking oil 1 (numeric)

Minyak Goreng Kemasan Bermerk 2

Price of branded packaged cooking oil 2 (numeric)

Gula Pasir

Price of granulated sugar (numeric)

Gula Pasir Kualitas Premium

Price of premium granulated sugar (numeric)

Gula Pasir Lokal

Price of local granulated sugar (numeric)

Details

The dataset name has been kept as 'DKIJakarta_tbl_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the IndonesiAPIs package and assists users in identifying its specific characteristics. The suffix 'tbl_df' indicates that the dataset is a tibble object. The original content has not been modified in any way.

Source

Data taken from the ifpd package version 0.1.0


Food Prices in Sumatera Utara

Description

This dataset, SumateraUtara_tbl_df, is a tibble containing food price data in Sumatera Utara, Indonesia. It includes prices for various food items such as rice, chicken, beef, eggs, onions, chilies, cooking oil, and sugar, recorded over multiple observations.

Usage

data(SumateraUtara_tbl_df)

Format

A tibble with 1,043 observations and 31 variables:

Tanggal

Date of the observation (character)

Beras

Price of rice (numeric)

Beras Kualitas Bawah I

Price of low quality rice I (numeric)

Beras Kualitas Bawah II

Price of low quality rice II (numeric)

Beras Kualitas Medium I

Price of medium quality rice I (numeric)

Beras Kualitas Medium II

Price of medium quality rice II (numeric)

Beras Kualitas Super I

Price of super quality rice I (numeric)

Beras Kualitas Super II

Price of super quality rice II (numeric)

Daging Ayam

Price of chicken meat (numeric)

Daging Ayam Ras Segar

Price of fresh broiler chicken meat (numeric)

Daging Sapi

Price of beef (numeric)

Daging Sapi Kualitas 1

Price of quality 1 beef (numeric)

Daging Sapi Kualitas 2

Price of quality 2 beef (numeric)

Telur Ayam

Price of chicken eggs (numeric)

Telur Ayam Ras Segar

Price of fresh broiler chicken eggs (numeric)

Bawang Merah

Price of red onions (numeric)

Bawang Merah Ukuran Sedang

Price of medium-sized red onions (numeric)

Bawang Putih

Price of garlic (numeric)

Bawang Putih Ukuran Sedang

Price of medium-sized garlic (numeric)

Cabai Merah

Price of red chilies (numeric)

Cabai Merah Keriting

Price of curly red chilies (numeric)

Cabai Rawit

Price of bird's eye chilies (numeric)

Cabai Rawit Hijau

Price of green bird's eye chilies (numeric)

Cabai Rawit Merah

Price of red bird's eye chilies (numeric)

Minyak Goreng

Price of cooking oil (numeric)

Minyak Goreng Curah

Price of bulk cooking oil (numeric)

Minyak Goreng Kemasan Bermerk 1

Price of branded packaged cooking oil 1 (numeric)

Minyak Goreng Kemasan Bermerk 2

Price of branded packaged cooking oil 2 (numeric)

Gula Pasir

Price of granulated sugar (numeric)

Gula Pasir Kualitas Premium

Price of premium granulated sugar (numeric)

Gula Pasir Lokal

Price of local granulated sugar (numeric)

Details

The dataset name has been kept as 'SumateraUtara_tbl_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the IndonesiAPIs package and assists users in identifying its specific characteristics. The suffix 'tbl_df' indicates that the dataset is a tibble object. The original content has not been modified in any way.

Source

Data taken from the ifpd package version 0.1.0


Bali Popular Tourist Destinations (2022)

Description

This dataset, bali_tourism_tbl_df, is a tibble containing information on 34 popular tourist destinations in Bali, Indonesia, as of 2022. It includes variables on place names, locations, coordinates, Google Maps ratings, review counts, sources, descriptions, and approximate tourism or visitor fees in USD. The dataset preserves the original structure from its source on Kaggle.

Usage

data(bali_tourism_tbl_df)

Format

A tibble with 34 observations and 8 variables:

Place

Name of the tourist destination (character)

Location

General location or area of the destination (character)

Coordinate

Geographic coordinates of the destination (character)

Google Maps Rating

Average rating from Google Maps (numeric)

Google Reviews (Count)

Number of reviews on Google Maps (numeric)

Source

Source of the information about the destination (character)

Description

Brief description of the tourist destination (character)

Tourism/Visitor Fee (approx in USD)

Approximate fee for tourists or visitors, in USD (character)

Details

The dataset name has been kept as 'bali_tourism_tbl_df' to maintain consistency with the naming conventions in the IndonesiAPIs package. The suffix 'tbl_df' indicates that this is a tibble data frame. The original content has not been modified in any way.

Source

Data obtained from Kaggle: https://www.kaggle.com/datasets/fuarresvij/bali-popular-destination-for-tourist-2022


Get Key Country Information About Indonesia from the REST Countries API

Description

Retrieves selected, essential information about Indonesia using the REST Countries API. The function returns a tibble with core details such as population, area, capital, region, and official language(s).

See the API documentation at https://restcountries.com/. Example API usage: https://restcountries.com/v3.1/name/indonesia?fullText=true.

Usage

get_country_info_idn()

Details

The function sends a GET request to the REST Countries API. If the API returns data for Indonesia, the function extracts and returns selected fields as a tibble. If the request fails or Indonesia is not found, it returns NULL and prints a message.

Value

A tibble with the following 8 columns:

Note

Requires internet connection. The data is retrieved in real time from the REST Countries API.

Source

REST Countries API: https://restcountries.com/

Examples

get_country_info_idn()


Get Under-5 Mortality Rate in Indonesia from World Bank

Description

Retrieves Indonesia's under-five mortality rate (per 1,000 live births) for the years 2010 to 2022 using the World Bank Open Data API. The indicator used is SH.DYN.MORT.

Usage

get_indonesia_child_mortality()

Details

This function sends a GET request to the World Bank API. If the API request fails or returns an error status code, the function returns NULL with an informative message.

Value

A tibble with the following columns:

Note

Requires internet connection.

Source

World Bank Open Data API: https://data.worldbank.org/indicator/SH.DYN.MORT

See Also

GET, fromJSON, as_tibble

Examples

if (interactive()) {
  get_indonesia_child_mortality()
}


Get Indonesia's Consumer Price Index from World Bank

Description

Retrieves Indonesia's Consumer Price Index (2010 = 100) for the years 2010 to 2022 using the World Bank Open Data API. The indicator used is FP.CPI.TOTL.

Usage

get_indonesia_cpi()

Details

The function sends a GET request to the World Bank API. If the API request fails or returns an error status code, the function returns NULL with an informative message.

Value

A tibble with the following columns:

Note

Requires internet connection. The data is retrieved in real time from the World Bank API.

Source

World Bank Open Data API: https://data.worldbank.org/indicator/FP.CPI.TOTL

See Also

GET, fromJSON, as_tibble

Examples

if (interactive()) {
  get_indonesia_cpi()
}


Get Indonesia's Energy Use (kg of oil equivalent per capita) from World Bank

Description

Retrieves Indonesia's energy use per capita, measured in kilograms of oil equivalent, for the years 2010 to 2022 using the World Bank Open Data API. The indicator used is EG.USE.PCAP.KG.OE.

Usage

get_indonesia_energy_use()

Details

This function sends a GET request to the World Bank API. If the API request fails or returns an error status code, the function returns NULL with an informative message.

Value

A tibble with the following columns:

Note

Requires internet connection.

Source

World Bank Open Data API: https://data.worldbank.org/indicator/EG.USE.PCAP.KG.OE

See Also

GET, fromJSON, as_tibble

Examples

if (interactive()) {
  get_indonesia_energy_use()
}


Get Indonesia's GDP (Current US$) from World Bank

Description

Retrieves Indonesia's Gross Domestic Product (GDP) in current US dollars for the years 2010 to 2022 using the World Bank Open Data API. The indicator used is NY.GDP.MKTP.CD.

Usage

get_indonesia_gdp()

Details

The function sends a GET request to the World Bank API. If the API request fails or returns an error status code, the function returns NULL with an informative message.

Value

A tibble with the following columns:

Note

Requires internet connection. The data is retrieved in real time from the World Bank API.

Source

World Bank Open Data API: https://data.worldbank.org/indicator/NY.GDP.MKTP.CD

See Also

GET, fromJSON, as_tibble, comma

Examples

if (interactive()) {
  get_indonesia_gdp()
}


Get Official Public Holidays in Indonesia for a Given Year

Description

Retrieves the list of official public holidays in Indonesia for a specific year using the Nager.Date public holidays API. This function returns a tibble containing the date of the holiday, the name in the local language (Indonesian), and the English name. It is useful for academic, planning, and data analysis purposes. The information is retrieved directly from the Nager.Date API and reflects the current status of holidays for the requested year. The field names returned are consistent with the API structure.

Usage

get_indonesia_holidays(year)

Arguments

year

An integer indicating the year (e.g., 2024 or 2025).

Value

A tibble with the following columns:

Source

Data obtained from the Nager.Date API: https://date.nager.at/

Examples

get_indonesia_holidays(2024)
get_indonesia_holidays(2025)


Get Hospital Beds per 1,000 People in Indonesia from World Bank

Description

Retrieves data on the number of hospital beds per 1,000 people in Indonesia from 2010 to 2022 using the World Bank Open Data API. The indicator used is SH.MED.BEDS.ZS.

Usage

get_indonesia_hospital_beds()

Details

This function sends a GET request to the World Bank API. If the API request fails or returns an error status code, the function returns NULL with an informative message.

Value

A tibble with the following columns:

Note

Requires internet connection.

Source

World Bank Open Data API: https://data.worldbank.org/indicator/SH.MED.BEDS.ZS

See Also

GET, fromJSON, as_tibble

Examples

if (interactive()) {
  get_indonesia_hospital_beds()
}


Get Indonesia's Life Expectancy at Birth from World Bank

Description

Retrieves Indonesia's life expectancy at birth (in years) for the years 2010 to 2022 using the World Bank Open Data API. The indicator used is SP.DYN.LE00.IN.

Usage

get_indonesia_life_expectancy()

Details

The function sends a GET request to the World Bank API. If the API request fails or returns an error status code, the function returns NULL with an informative message.

Value

A tibble with the following columns:

Note

Requires internet connection. The data is retrieved in real time from the World Bank API.

Source

World Bank Open Data API: https://data.worldbank.org/indicator/SP.DYN.LE00.IN

See Also

GET, fromJSON, as_tibble

Examples

if (interactive()) {
  get_indonesia_life_expectancy()
}


Get Indonesia's Literacy Rate (Age 15+) from World Bank

Description

Retrieves Indonesia's literacy rate for adults aged 15 and above, expressed as a percentage, for the years 2010 to 2022 using the World Bank Open Data API. The indicator used is SE.ADT.LITR.ZS.

Usage

get_indonesia_literacy_rate()

Details

The function sends a GET request to the World Bank API. If the API request fails or returns an error status code, the function returns NULL with an informative message.

Value

A tibble with the following columns:

Note

Requires internet connection. The data is retrieved in real time from the World Bank API.

Source

World Bank Open Data API: https://data.worldbank.org/indicator/SE.ADT.LITR.ZS

See Also

GET, fromJSON, as_tibble

Examples

if (interactive()) {
  get_indonesia_literacy_rate()
}


Get Indonesia's Total Population from World Bank

Description

Retrieves Indonesia's total population for the years 2010 to 2022 using the World Bank Open Data API. The indicator used is SP.POP.TOTL.

Usage

get_indonesia_population()

Details

The function sends a GET request to the World Bank API. If the API request fails or returns an error status code, the function returns NULL with an informative message.

Value

A tibble with the following columns:

Note

Requires internet connection. The data is retrieved in real time from the World Bank API.

Source

World Bank Open Data API: https://data.worldbank.org/indicator/SP.POP.TOTL

See Also

GET, fromJSON, as_tibble, comma

Examples

if (interactive()) {
  get_indonesia_population()
}


Get Indonesia's Unemployment Rate from World Bank

Description

Retrieves Indonesia's Unemployment, total ( for the years 2010 to 2022 using the World Bank Open Data API. The indicator used is SL.UEM.TOTL.ZS.

Usage

get_indonesia_unemployment()

Details

The function sends a GET request to the World Bank API. If the API request fails or returns an error status code, the function returns NULL with an informative message.

Value

A tibble with the following columns:

Note

Requires internet connection. The data is retrieved in real time from the World Bank API.

Source

World Bank Open Data API: https://data.worldbank.org/indicator/SL.UEM.TOTL.ZS

See Also

GET, fromJSON, as_tibble

Examples

if (interactive()) {
  get_indonesia_unemployment()
}


Coordinate of Several Regions in Indonesia

Description

This dataset, indonesia_latlong_df, is a data frame containing the geographical coordinates of several regions in Indonesia, specifically Semarang, Surakarta, Tegal, and Purwokerto. It includes the city names and their respective latitude and longitude values.

Usage

data(indonesia_latlong_df)

Format

A data frame with 4 observations and 3 variables:

City

Name of the region in Indonesia (character)

latitude

Latitude coordinate of the region (numeric)

longitude

Longitude coordinate of the region (numeric)

Details

The dataset name has been kept as 'indonesia_latlong_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the IndonesiAPIs package and assists users in identifying its specific characteristics. The suffix 'df' indicates that the dataset is a data frame. The original content has not been modified in any way.

Source

Data taken from the gstar package version 0.1.0


Indonesian Minimum Wage by Region (1997-2025)

Description

This dataset, indonesia_minwage_tbl_df, is a tibble containing monthly minimum wage or Upah Minimum Regional (UMR) data in Indonesian Rupiah (IDR) across various regions of Indonesia from 1997 to 2025. The dataset preserves the original structure from its source on Kaggle.

Usage

data(indonesia_minwage_tbl_df)

Format

A tibble with 983 observations and 3 variables:

REGION

Name of the region in Indonesia (character)

SALARY

Monthly minimum wage in Indonesian Rupiah (IDR) (numeric)

YEAR

Year of the minimum wage data (numeric)

Details

The dataset name has been kept as 'indonesia_minwage_tbl_df' to maintain consistency with the naming conventions in the IndonesiAPIs package. The suffix 'tbl_df' indicates that this is a tibble data frame. The original content has not been modified in any way.

Source

Data obtained from Kaggle: https://www.kaggle.com/datasets/linkgish/indonesian-salary-by-region-19972022


View Available Datasets in IndonesiAPIs

Description

This function lists all datasets available in the 'IndonesiAPIs' package. If the 'IndonesiAPIs' package is not loaded, it stops and shows an error message. If no datasets are available, it returns a message and an empty vector.

Usage

view_datasets_IndonesiAPIs()

Value

A character vector with the names of the available datasets. If no datasets are found, it returns an empty character vector.

Examples

if (requireNamespace("IndonesiAPIs", quietly = TRUE)) {
  library(IndonesiAPIs)
  view_datasets_IndonesiAPIs()
}