Type: | Package |
Title: | Access Algerian Data via Public APIs |
Version: | 0.1.0 |
Maintainer: | Renzo Caceres Rossi <arenzocaceresrossi@gmail.com> |
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/. |
License: | MIT + file LICENSE |
Language: | en |
URL: | https://github.com/lightbluetitan/algeriapis, https://lightbluetitan.github.io/algeriapis/ |
BugReports: | https://github.com/lightbluetitan/algeriapis/issues |
Encoding: | UTF-8 |
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-30 16:13:11 UTC; Renzo |
Author: | Renzo Caceres Rossi
|
Repository: | CRAN |
Date/Publication: | 2025-10-06 08:40:15 UTC |
AlgeriAPIs: Access Algerian Data via Public APIs
Description
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.
Details
AlgeriAPIs: Access Algerian Data via Public APIs
Access Algerian Data via Public APIs.
Author(s)
Maintainer: Renzo Caceres Rossi arenzocaceresrossi@gmail.com
See Also
Useful links:
Daily Maximum and Minimum Air Temperatures for Algiers, Algeria
Description
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.
Usage
data(algiers_temp_df)
Format
A data frame with 16,436 observations and 3 variables:
- t
Date of observation (Date)
- tMax
Daily maximum air temperature in degrees Celsius (numeric)
- tMin
Daily minimum air temperature in degrees Celsius (numeric)
Details
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.
Source
Data taken from the heatwaveR package version 0.5.4
Get Algeria's Under-5 Mortality Rate from World Bank
Description
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
.
Usage
get_algeria_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:
-
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)
Note
Requires internet connection.
Source
World Bank Open Data API: https://data.worldbank.org/indicator/SH.DYN.MORT
See Also
Examples
if (interactive()) {
get_algeria_child_mortality()
}
Get Algeria's Consumer Price Index (2010 = 100) from World Bank
Description
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
.
Usage
get_algeria_cpi()
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:
-
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)
Note
Requires internet connection.
Source
World Bank Open Data API: https://data.worldbank.org/indicator/FP.CPI.TOTL
See Also
Examples
if (interactive()) {
get_algeria_cpi()
}
Get Algeria's Energy Use (kg of oil equivalent per capita) from World Bank
Description
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
.
Usage
get_algeria_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:
-
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
Note
Requires internet connection.
Source
World Bank Open Data API: https://data.worldbank.org/indicator/EG.USE.PCAP.KG.OE
See Also
Examples
if (interactive()) {
get_algeria_energy_use()
}
Get Algeria's GDP (current US$) from World Bank
Description
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
.
Usage
get_algeria_gdp()
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:
-
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")
Note
Requires internet connection.
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_algeria_gdp()
}
Get Algeria's Hospital Beds (per 1,000 people) from World Bank
Description
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
.
Usage
get_algeria_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:
-
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
Note
Requires internet connection.
Source
World Bank Open Data API: https://data.worldbank.org/indicator/SH.MED.BEDS.ZS
See Also
Examples
if (interactive()) {
get_algeria_hospital_beds()
}
Get Algeria's Life Expectancy at Birth (Total, Years) from World Bank
Description
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
.
Usage
get_algeria_life_expectancy()
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:
-
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
Note
Requires internet connection.
Source
World Bank Open Data API: https://data.worldbank.org/indicator/SP.DYN.LE00.IN
See Also
Examples
if (interactive()) {
get_algeria_life_expectancy()
}
Get Algeria's Adult Literacy Rate
Description
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
.
Usage
get_algeria_literacy_rate()
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:
-
indicator
: Indicator name -
country
: Country name ("Algeria") -
year
: Year of the data (integer) -
value
: Literacy rate as a percentage
Note
Requires internet connection.
Source
World Bank Open Data API: https://data.worldbank.org/indicator/SE.ADT.LITR.ZS
See Also
Examples
literacy_data <- get_algeria_literacy_rate()
head(literacy_data)
Get Algeria's Total Population from World Bank
Description
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
.
Usage
get_algeria_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:
-
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")
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_algeria_population()
}
Get Algeria's Unemployment Rate (Total) from World Bank
Description
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
.
Usage
get_algeria_unemployment()
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:
-
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)
Note
Requires internet connection.
Source
World Bank Open Data API: https://data.worldbank.org/indicator/SL.UEM.TOTL.ZS
See Also
Examples
if (interactive()) {
get_algeria_unemployment()
}
Get Country Information for Algeria
Description
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.
Usage
get_country_info_dz()
Value
A tibble with one row containing Algeria's country information, or NULL if the API is unavailable.
Examples
dz_info <- get_country_info_dz()
print(dz_info)
Internet Users in Algeria
Description
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.
Usage
data(internet_users_tbl_df)
Format
A tibble with 32 observations and 6 variables:
- Year
Year of observation (numeric)
- Algeria
Percentage of Internet users in Algeria (numeric)
- Maghreb_union
Percentage of Internet users in the Maghreb Union (numeric)
- Arab_world
Percentage of Internet users in the Arab World (numeric)
- European_Union
Percentage of Internet users in the European Union (numeric)
- The_World
Percentage of Internet users globally (numeric)
Details
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.
Source
Data obtained from Kaggle: https://www.kaggle.com/datasets/fundal/algeria-five-indicators
View Available Datasets in AlgeriAPIs
Description
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.
Usage
view_datasets_AlgeriAPIs()
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("AlgeriAPIs", quietly = TRUE)) {
library(AlgeriAPIs)
view_datasets_AlgeriAPIs()
}