| Title: | Access Indonesian Data via Public APIs and Curated Datasets |
|---|---|
| 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/>. |
| Authors: | Renzo Caceres Rossi [aut, cre] (ORCID: <https://orcid.org/0009-0005-0744-854X>) |
| Maintainer: | Renzo Caceres Rossi <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.1 |
| Built: | 2026-05-26 07:30:08 UTC |
| Source: | https://github.com/lightbluetitan/indonesiapis |
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.
data(Bali_tbl_df)data(Bali_tbl_df)
A tibble with 1,043 observations and 30 variables:
Date of the observation (character)
Price of rice (numeric)
Price of medium quality rice I (numeric)
Price of medium quality rice II (numeric)
Price of super quality rice I (numeric)
Price of super quality rice II (numeric)
Price of chicken meat (numeric)
Price of fresh broiler chicken meat (numeric)
Price of beef (numeric)
Price of quality 1 beef (numeric)
Price of quality 2 beef (numeric)
Price of chicken eggs (numeric)
Price of fresh broiler chicken eggs (numeric)
Price of red onions (numeric)
Price of medium-sized red onions (numeric)
Price of garlic (numeric)
Price of medium-sized garlic (numeric)
Price of red chilies (numeric)
Price of large red chilies (numeric)
Price of curly red chilies (numeric)
Price of bird's eye chilies (numeric)
Price of green bird's eye chilies (numeric)
Price of red bird's eye chilies (numeric)
Price of cooking oil (numeric)
Price of bulk cooking oil (numeric)
Price of branded packaged cooking oil 1 (numeric)
Price of branded packaged cooking oil 2 (numeric)
Price of granulated sugar (numeric)
Price of premium granulated sugar (numeric)
Price of local granulated sugar (numeric)
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.
Data taken from the ifpd package version 0.1.0
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.
data(bali_tourism_tbl_df)data(bali_tourism_tbl_df)
A tibble with 34 observations and 8 variables:
Name of the tourist destination (character)
General location or area of the destination (character)
Geographic coordinates of the destination (character)
Average rating from Google Maps (numeric)
Number of reviews on Google Maps (numeric)
Source of the information about the destination (character)
Brief description of the tourist destination (character)
Approximate fee for tourists or visitors, in USD (character)
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.
Data obtained from Kaggle: https://www.kaggle.com/datasets/fuarresvij/bali-popular-destination-for-tourist-2022
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.
data(DKIJakarta_tbl_df)data(DKIJakarta_tbl_df)
A tibble with 1,043 observations and 32 variables:
Date of the observation (character)
Price of rice (numeric)
Price of low quality rice I (numeric)
Price of low quality rice II (numeric)
Price of medium quality rice I (numeric)
Price of medium quality rice II (numeric)
Price of super quality rice I (numeric)
Price of super quality rice II (numeric)
Price of chicken meat (numeric)
Price of fresh broiler chicken meat (numeric)
Price of beef (numeric)
Price of quality 1 beef (numeric)
Price of quality 2 beef (numeric)
Price of chicken eggs (numeric)
Price of fresh broiler chicken eggs (numeric)
Price of red onions (numeric)
Price of medium-sized red onions (numeric)
Price of garlic (numeric)
Price of medium-sized garlic (numeric)
Price of red chilies (numeric)
Price of large red chilies (numeric)
Price of curly red chilies (numeric)
Price of bird's eye chilies (numeric)
Price of green bird's eye chilies (numeric)
Price of red bird's eye chilies (numeric)
Price of cooking oil (numeric)
Price of bulk cooking oil (numeric)
Price of branded packaged cooking oil 1 (numeric)
Price of branded packaged cooking oil 2 (numeric)
Price of granulated sugar (numeric)
Price of premium granulated sugar (numeric)
Price of local granulated sugar (numeric)
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.
Data taken from the ifpd package version 0.1.0
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.
get_country_info_idn()get_country_info_idn()
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.
A tibble with the following 8 columns:
name_common: Common name of the country.
name_official: Official name of the country.
region: Geographical region.
subregion: Subregion within the continent.
capital: Capital city.
area: Area in square kilometers.
population: Population of the country.
languages: Languages spoken in the country, as a comma-separated string.
Returns NULL if the API is unavailable or returns an error.
Requires internet connection. The data is retrieved in real time from the REST Countries API.
REST Countries API: https://restcountries.com/
get_country_info_idn()get_country_info_idn()
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.
get_indonesia_child_mortality()get_indonesia_child_mortality()
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.
A tibble with the following columns:
indicator: Indicator name (e.g., "Mortality rate, under-5 (per 1,000 live births)")
country: Country name ("Indonesia")
year: Year of the data (integer)
value: Under-5 mortality rate per 1,000 live births (numeric)
Returns NULL if the API is unavailable or returns an error.
Requires internet connection.
World Bank Open Data API: https://data.worldbank.org/indicator/SH.DYN.MORT
get_indonesia_child_mortality()get_indonesia_child_mortality()
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.
get_indonesia_cpi()get_indonesia_cpi()
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.
A tibble with the following columns:
indicator: Indicator name (e.g., "Consumer price index (2010 = 100)")
country: Country name ("Indonesia")
year: Year of the data (integer)
value: Consumer Price Index value in numeric form
Returns NULL if the API is unavailable or returns an error.
Requires internet connection. The data is retrieved in real time from the World Bank API.
World Bank Open Data API: https://data.worldbank.org/indicator/FP.CPI.TOTL
get_indonesia_cpi()get_indonesia_cpi()
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.
get_indonesia_energy_use()get_indonesia_energy_use()
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.
A tibble with the following columns:
indicator: Indicator name (e.g., "Energy use (kg of oil equivalent per capita)")
country: Country name ("Indonesia")
year: Year of the data (integer)
value: Energy use in kilograms of oil equivalent per capita
Returns NULL if the API is unavailable or returns an error.
Requires internet connection.
World Bank Open Data API: https://data.worldbank.org/indicator/EG.USE.PCAP.KG.OE
get_indonesia_energy_use()get_indonesia_energy_use()
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.
get_indonesia_gdp()get_indonesia_gdp()
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.
A tibble with the following columns:
indicator: Indicator name (e.g., "GDP (current US$)")
country: Country name ("Indonesia")
year: Year of the data (integer)
value: GDP value in numeric form
value_label: Formatted GDP value (e.g., "1,466,464,899,304")
Returns NULL if the API is unavailable or returns an error.
Requires internet connection. The data is retrieved in real time from the World Bank API.
World Bank Open Data API: https://data.worldbank.org/indicator/NY.GDP.MKTP.CD
GET, fromJSON, as_tibble, comma
get_indonesia_gdp()get_indonesia_gdp()
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.
get_indonesia_holidays(year)get_indonesia_holidays(year)
year |
An integer indicating the year (e.g., 2024 or 2025). |
A tibble with the following columns:
date: Date of the holiday (class Date)
local_name: Holiday name in the local language (Indonesian)
name: Holiday name in English
Returns NULL if the API is unavailable or returns an error.
Data obtained from the Nager.Date API: https://date.nager.at/
get_indonesia_holidays(2024) get_indonesia_holidays(2025)get_indonesia_holidays(2024) get_indonesia_holidays(2025)
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.
get_indonesia_hospital_beds()get_indonesia_hospital_beds()
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.
A tibble with the following columns:
indicator: Indicator name (e.g., "Hospital beds (per 1,000 people)")
country: Country name ("Indonesia")
year: Year of the data (integer)
value: Hospital beds per 1,000 people (numeric)
Returns NULL if the API is unavailable or returns an error.
Requires internet connection.
World Bank Open Data API: https://data.worldbank.org/indicator/SH.MED.BEDS.ZS
get_indonesia_hospital_beds()get_indonesia_hospital_beds()
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.
get_indonesia_life_expectancy()get_indonesia_life_expectancy()
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.
A tibble with the following columns:
indicator: Indicator name (e.g., "Life expectancy at birth, total (years)")
country: Country name ("Indonesia")
year: Year of the data (integer)
value: Life expectancy value in numeric form (years)
Returns NULL if the API is unavailable or returns an error.
Requires internet connection. The data is retrieved in real time from the World Bank API.
World Bank Open Data API: https://data.worldbank.org/indicator/SP.DYN.LE00.IN
get_indonesia_life_expectancy()get_indonesia_life_expectancy()
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.
get_indonesia_literacy_rate()get_indonesia_literacy_rate()
The function sends a GET request to the World Bank API.
If the request fails (timeout, network error, or invalid HTTP status),
the function returns NULL with an informative message.
A tibble with columns:
indicator: Indicator name.
country: Country name ("Indonesia").
year: Year (integer).
value: Literacy rate (numeric percentage).
Returns NULL if the API is unavailable or returns an error.
Requires internet connection.
World Bank Open Data API: https://data.worldbank.org/indicator/SE.ADT.LITR.ZS
get_indonesia_literacy_rate()get_indonesia_literacy_rate()
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.
get_indonesia_population()get_indonesia_population()
If the API request fails for any reason (network issue, timeout,
invalid HTTP status, or malformed JSON), the function returns NULL
with an informative message.
A tibble with:
indicator: Indicator name.
country: Country name ("Indonesia").
year: Year (integer).
value: Population (numeric).
value_label: Formatted population (e.g., "126,000,000").
Returns NULL if API request fails or data is unavailable.
Requires internet connection.
World Bank Open Data API: https://data.worldbank.org/indicator/SP.POP.TOTL
get_indonesia_population()get_indonesia_population()
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.
get_indonesia_unemployment()get_indonesia_unemployment()
If the API request fails for any reason (network issue, timeout,
invalid HTTP status, or malformed JSON), the function returns NULL
with an informative message.
A tibble with:
indicator: Indicator name.
country: Country name ("Indonesia").
year: Year (integer).
value: Unemployment rate (numeric).
value_label: Formatted unemployment rate (e.g., "5.2
Returns NULL if API request fails or data is unavailable.
Requires internet connection.
World Bank Open Data API: https://data.worldbank.org/indicator/SL.UEM.TOTL.ZS
get_indonesia_unemployment()get_indonesia_unemployment()
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.
data(indonesia_latlong_df)data(indonesia_latlong_df)
A data frame with 4 observations and 3 variables:
Name of the region in Indonesia (character)
Latitude coordinate of the region (numeric)
Longitude coordinate of the region (numeric)
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.
Data taken from the gstar package version 0.1.0
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.
data(indonesia_minwage_tbl_df)data(indonesia_minwage_tbl_df)
A tibble with 983 observations and 3 variables:
Name of the region in Indonesia (character)
Monthly minimum wage in Indonesian Rupiah (IDR) (numeric)
Year of the minimum wage data (numeric)
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.
Data obtained from Kaggle: https://www.kaggle.com/datasets/linkgish/indonesian-salary-by-region-19972022
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.
IndonesiAPIs: Access Indonesian Data via Public APIs and Curated Datasets
Access Indonesian Data via Public APIs and Curated Datasets.
Maintainer: Renzo Caceres Rossi [email protected]
Useful links:
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.
data(SumateraUtara_tbl_df)data(SumateraUtara_tbl_df)
A tibble with 1,043 observations and 31 variables:
Date of the observation (character)
Price of rice (numeric)
Price of low quality rice I (numeric)
Price of low quality rice II (numeric)
Price of medium quality rice I (numeric)
Price of medium quality rice II (numeric)
Price of super quality rice I (numeric)
Price of super quality rice II (numeric)
Price of chicken meat (numeric)
Price of fresh broiler chicken meat (numeric)
Price of beef (numeric)
Price of quality 1 beef (numeric)
Price of quality 2 beef (numeric)
Price of chicken eggs (numeric)
Price of fresh broiler chicken eggs (numeric)
Price of red onions (numeric)
Price of medium-sized red onions (numeric)
Price of garlic (numeric)
Price of medium-sized garlic (numeric)
Price of red chilies (numeric)
Price of curly red chilies (numeric)
Price of bird's eye chilies (numeric)
Price of green bird's eye chilies (numeric)
Price of red bird's eye chilies (numeric)
Price of cooking oil (numeric)
Price of bulk cooking oil (numeric)
Price of branded packaged cooking oil 1 (numeric)
Price of branded packaged cooking oil 2 (numeric)
Price of granulated sugar (numeric)
Price of premium granulated sugar (numeric)
Price of local granulated sugar (numeric)
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.
Data taken from the ifpd package version 0.1.0
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.
view_datasets_IndonesiAPIs()view_datasets_IndonesiAPIs()
A character vector with the names of the available datasets. If no datasets are found, it returns an empty character vector.
if (requireNamespace("IndonesiAPIs", quietly = TRUE)) { library(IndonesiAPIs) view_datasets_IndonesiAPIs() }if (requireNamespace("IndonesiAPIs", quietly = TRUE)) { library(IndonesiAPIs) view_datasets_IndonesiAPIs() }