| Title: | Access Algerian Data via Public APIs |
|---|---|
| Description: | Provides functions to access data from public RESTful APIs including 'World Bank API' and 'REST Countries API', retrieving real-time or historical information related to Algeria. The package enables users to query economic indicators and international demographic and geopolitical statistics in a reproducible way. It is designed for researchers, analysts, and developers who require reliable and programmatic access to Algerian data through established APIs. For more information on the APIs, see: '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.0 |
| Built: | 2026-06-04 09:24:38 UTC |
| Source: | https://github.com/lightbluetitan/algeriapis |
This package provides functions to access data from public RESTful APIs including World Bank API and REST Countries API, retrieving real-time or historical information related to Algeria.
AlgeriAPIs: Access Algerian Data via Public APIs
Access Algerian Data via Public APIs.
Maintainer: Renzo Caceres Rossi [email protected]
Useful links:
This dataset, algiers_temp_df, is a data frame containing daily maximum and minimum air temperature records for Algiers, Algeria. It provides a comprehensive time series of temperature measurements useful for climate analysis, heatwave detection, and meteorological research.
data(algiers_temp_df)data(algiers_temp_df)
A data frame with 16,436 observations and 3 variables:
Date of observation (Date)
Daily maximum air temperature in degrees Celsius (numeric)
Daily minimum air temperature in degrees Celsius (numeric)
The dataset name has been kept as 'algiers_temp_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the AlgeriAPIs package and assists users in identifying its specific characteristics. The suffix 'df' indicates that the dataset is a data frame object. The original content has not been modified in any way.
Data taken from the heatwaveR package version 0.5.4
Retrieves Algeria's under-5 mortality rate, measured as the number of deaths
of children under five years of age 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_algeria_child_mortality()get_algeria_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 ("Algeria")
year: Year of the data (integer)
value: Mortality rate (per 1,000 live births)
Requires internet connection.
World Bank Open Data API: https://data.worldbank.org/indicator/SH.DYN.MORT
if (interactive()) { get_algeria_child_mortality() }if (interactive()) { get_algeria_child_mortality() }
Retrieves Algeria's Consumer Price Index (CPI), with 2010 as the base year (index = 100),
for the years 2010 to 2022 using the World Bank Open Data API.
The indicator used is FP.CPI.TOTL.
get_algeria_cpi()get_algeria_cpi()
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., "Consumer price index (2010 = 100)")
country: Country name ("Algeria")
year: Year of the data (integer)
value: Consumer Price Index (numeric, base year 2010 = 100)
Requires internet connection.
World Bank Open Data API: https://data.worldbank.org/indicator/FP.CPI.TOTL
if (interactive()) { get_algeria_cpi() }if (interactive()) { get_algeria_cpi() }
Retrieves Algeria'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_algeria_energy_use()get_algeria_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 ("Algeria")
year: Year of the data (integer)
value: Energy use in kilograms of oil equivalent per capita
Requires internet connection.
World Bank Open Data API: https://data.worldbank.org/indicator/EG.USE.PCAP.KG.OE
if (interactive()) { get_algeria_energy_use() }if (interactive()) { get_algeria_energy_use() }
Retrieves Algeria'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_algeria_gdp()get_algeria_gdp()
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., "GDP (current US$)")
country: Country name ("Algeria")
year: Year of the data (integer)
value: GDP in current US dollars
value_label: Formatted GDP with commas (e.g., "1,800,000,000,000")
Requires internet connection.
World Bank Open Data API: https://data.worldbank.org/indicator/NY.GDP.MKTP.CD
GET, fromJSON, as_tibble, comma
if (interactive()) { get_algeria_gdp() }if (interactive()) { get_algeria_gdp() }
Retrieves Algeria's number of hospital beds per 1,000 people
for the years 2010 to 2022 using the World Bank Open Data API.
The indicator used is SH.MED.BEDS.ZS.
get_algeria_hospital_beds()get_algeria_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 ("Algeria")
year: Year of the data (integer)
value: Number of hospital beds per 1,000 people
Requires internet connection.
World Bank Open Data API: https://data.worldbank.org/indicator/SH.MED.BEDS.ZS
if (interactive()) { get_algeria_hospital_beds() }if (interactive()) { get_algeria_hospital_beds() }
Retrieves Algeria's life expectancy at birth (total, years)
for the years 2010 to 2022 using the World Bank Open Data API.
The indicator used is SP.DYN.LE00.IN.
get_algeria_life_expectancy()get_algeria_life_expectancy()
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., "Life expectancy at birth, total (years)")
country: Country name ("Algeria")
year: Year of the data (integer)
value: Life expectancy at birth in years
Requires internet connection.
World Bank Open Data API: https://data.worldbank.org/indicator/SP.DYN.LE00.IN
if (interactive()) { get_algeria_life_expectancy() }if (interactive()) { get_algeria_life_expectancy() }
Retrieves Algeria's adult literacy rate (
for the years 2010 to 2022 using the World Bank Open Data API.
The indicator used is SE.ADT.LITR.ZS.
get_algeria_literacy_rate()get_algeria_literacy_rate()
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
country: Country name ("Algeria")
year: Year of the data (integer)
value: Literacy rate as a percentage
Requires internet connection.
World Bank Open Data API: https://data.worldbank.org/indicator/SE.ADT.LITR.ZS
literacy_data <- get_algeria_literacy_rate() head(literacy_data)literacy_data <- get_algeria_literacy_rate() head(literacy_data)
Retrieves Algeria's total population for the years 2010 to 2022
using the World Bank Open Data API. The indicator used is SP.POP.TOTL.
get_algeria_population()get_algeria_population()
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., "Population, total")
country: Country name ("Algeria")
year: Year of the data (integer)
value: Population as a numeric value
value_label: Formatted population with commas (e.g., "51,000,000")
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.POP.TOTL
GET, fromJSON, as_tibble, comma
if (interactive()) { get_algeria_population() }if (interactive()) { get_algeria_population() }
Retrieves Algeria's total unemployment rate, measured as a percentage of the total labor force,
for the years 2010 to 2022 using the World Bank Open Data API.
The indicator used is SL.UEM.TOTL.ZS.
get_algeria_unemployment()get_algeria_unemployment()
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., "Unemployment, total (
country: Country name ("Algeria")
year: Year of the data (integer)
value: Unemployment rate as a numeric value (percentage)
Requires internet connection.
World Bank Open Data API: https://data.worldbank.org/indicator/SL.UEM.TOTL.ZS
if (interactive()) { get_algeria_unemployment() }if (interactive()) { get_algeria_unemployment() }
Retrieves comprehensive country information for Algeria from the REST Countries API. This function fetches data including official and common names, geographical information, capital, area, population, and languages.
get_country_info_dz()get_country_info_dz()
A tibble with one row containing Algeria's country information, or NULL if the API is unavailable.
dz_info <- get_country_info_dz() print(dz_info)dz_info <- get_country_info_dz() print(dz_info)
This dataset, internet_users_tbl_df, is a tibble containing the percentage of Internet users in Algeria and comparative data for regional and global contexts. It tracks the percentage of individuals using the Internet over time for Algeria, the Maghreb Union, the Arab World, the European Union, and the World average.
data(internet_users_tbl_df)data(internet_users_tbl_df)
A tibble with 32 observations and 6 variables:
Year of observation (numeric)
Percentage of Internet users in Algeria (numeric)
Percentage of Internet users in the Maghreb Union (numeric)
Percentage of Internet users in the Arab World (numeric)
Percentage of Internet users in the European Union (numeric)
Percentage of Internet users globally (numeric)
The dataset name has been kept as 'internet_users_tbl_df' to avoid confusion with other datasets in the R ecosystem. This naming convention helps distinguish this dataset as part of the AlgeriAPIs 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 obtained from Kaggle: https://www.kaggle.com/datasets/fundal/algeria-five-indicators
This function lists all datasets available in the 'AlgeriAPIs' package. If the 'AlgeriAPIs' 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_AlgeriAPIs()view_datasets_AlgeriAPIs()
A character vector with the names of the available datasets. If no datasets are found, it returns an empty character vector.
if (requireNamespace("AlgeriAPIs", quietly = TRUE)) { library(AlgeriAPIs) view_datasets_AlgeriAPIs() }if (requireNamespace("AlgeriAPIs", quietly = TRUE)) { library(AlgeriAPIs) view_datasets_AlgeriAPIs() }