TheIndiAPIs package provides a unified interface toaccess open data from theWorld Bank API and theREST Countries API, with a focus onIndia. It allows users to retrieve up-to-date orhistorical information on topics such as economic indicators,international demographic statistics, and key geopolitical detailsrelated to India.
In addition to API-access functions, the package includes one of thelargest curated collections of open datasets focused onIndia. These datasets cover a wide range of topicsincluding population, economy, weather, politics, health, biodiversity,sports, agriculture, cybercrime, infrastructure, and more.
You can install theIndiAPIs package from CRAN with thefollowing R function:
install.packages("IndiAPIs")After installation, load the package and start exploring and usingits functions and datasets.
library(IndiAPIs)Below is a list of the main functions included in the package:
get_india_child_mortality(): Get India’s Under-5Mortality Rate from World Bank.
get_india_cpi(): Get India’s Consumer Price Index(2010 = 100) from World Bank.
get_india_energy_use(): Get India’s Energy Use (kgof oil equivalent per capita) from World Bank.
get_india_gdp(): Get India’s GDP (current US$) fromWorld Bank.
get_india_hospital_beds(): Get India’s Hospital Beds(per 1,000 people) from World Bank.
get_india_life_expectancy(): Get India’s LifeExpectancy at Birth from World Bank.
get_india_literacy_rate(): Get India’s AdultLiteracy Rate from World Bank.
get_india_population(): Get India’s Total Populationfrom World Bank.
get_india_unemployment(): Get India’s UnemploymentRate (% of total labor force) from World Bank.
get_country_info_in(): Get Key Country Informationfor India.
view_datasets_IndiAPIs(): View Available Datasets inIndiAPIs.
Each dataset inIndiAPIs is labeled with asuffix to indicate its structure and type:
_df: A standard data frame object.
_dt: A data table object.
_ts: A time series object.
In addition to API access functions,IndiAPIs offers oneof the largest curated collections of open datasets focused onIndia. These preloaded datasets cover a wide range oftopics including population, economy, weather, politics, health,biodiversity, sports, agriculture, cybercrime, infrastructure, and more.Below are some featured examples:
BurdwanWeather_df: A data frame containing weeklyweather data for the rice growing season in the Burdwan district of WestBengal, India.
birds_watching_tbl_df: A tibble containing detailedinformation on bird species observed in India, including species names,scientific names, the date of last observation.
DelhiPotatoPrices_ts: A time series containing themonthly average potato prices of the Delhi market from January 2010 toJuly 2020.
# Load the packagelibrary(IndiAPIs)# Retrieves essential information about Indiaget_country_info_in()# Get India's Population (Total) from World Bankget_india_population()# Load a datasetdata(India_census2011_tbl_df)# Shows six rows of the datasethead(India_census2011_tbl_df)# Display the structure of the datasetstr(India_census2011_tbl_df)# Shows the whole datasetView(India_census2011_tbl_df)