Learn R Programming

IndiAPIs

The IndiAPIs package provides a unified interface to access open data from the World Bank API and the REST Countries API, with a focus on India. It allows users to retrieve up-to-date or historical information on topics such as economic indicators, international demographic statistics, and key geopolitical details related to India.

In addition to API-access functions, the package includes one of the largest curated collections of open datasets focused on India. These datasets cover a wide range of topics including population, economy, weather, politics, health, biodiversity, sports, agriculture, cybercrime, infrastructure, and more.

Installation

You can install the IndiAPIs package from CRAN with the following R function:


install.packages("IndiAPIs")

Usage

After installation, load the package and start exploring and using its functions and datasets.


library(IndiAPIs)

IndiAPIs Functions

Below is a list of the main functions included in the package:

  • get_india_child_mortality(): Get India's Under-5 Mortality 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 (kg of oil equivalent per capita) from World Bank.

  • get_india_gdp(): Get India's GDP (current US$) from World Bank.

  • get_india_hospital_beds(): Get India's Hospital Beds (per 1,000 people) from World Bank.

  • get_india_life_expectancy(): Get India's Life Expectancy at Birth from World Bank.

  • get_india_literacy_rate(): Get India's Adult Literacy Rate from World Bank.

  • get_india_population(): Get India's Total Population from World Bank.

  • get_india_unemployment(): Get India's Unemployment Rate (% of total labor force) from World Bank.

  • get_country_info_in(): Get Key Country Information for India.

  • view_datasets_IndiAPIs(): View Available Datasets in IndiAPIs.

Dataset Suffixes

Each dataset in IndiAPIs is labeled with a suffix to indicate its structure and type:

  • _df: A standard data frame object.

  • _dt: A data table object.

  • _ts: A time series object.

Datasets Included in IndiAPIs

In addition to API access functions, IndiAPIs offers one of the largest curated collections of open datasets focused on India. These preloaded datasets cover a wide range of topics including population, economy, weather, politics, health, biodiversity, sports, agriculture, cybercrime, infrastructure, and more. Below are some featured examples:

  • BurdwanWeather_df: A data frame containing weekly weather data for the rice growing season in the Burdwan district of West Bengal, India.

  • birds_watching_tbl_df: A tibble containing detailed information on bird species observed in India,

including species names, scientific names, the date of last observation.

  • DelhiPotatoPrices_ts: A time series containing the monthly average potato prices of the Delhi market from January 2010 to July 2020.

Example Code:


# Load the package

library(IndiAPIs)

# Retrieves essential information about India

get_country_info_in()

# Get India's Population (Total) from World Bank

get_india_population()

# Load a dataset

data(India_census2011_tbl_df)

# Shows six rows of the dataset

head(India_census2011_tbl_df)

# Display the structure of the dataset

str(India_census2011_tbl_df)

# Shows the whole dataset

View(India_census2011_tbl_df)

Copy Link

Version

Install

install.packages('IndiAPIs')

Monthly Downloads

153

Version

0.1.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Renzo Caceres Rossi

Last Published

August 26th, 2025

Functions in IndiAPIs (0.1.0)

India_SharkTank_tbl_df

Shark Tank India Dataset
birds_watching_tbl_df

Indian Bird Observations: Tracking Species
get_india_child_mortality

Get India's Under-5 Mortality Rate from World Bank
Top500Cities_tbl_df

Top 500 Indian Cities
get_country_info_in

Get Country Information for India
exports_imports_tbl_df

Exports and Imports of India (1997-July 2022)
get_india_energy_use

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

Get India's GDP (current US$) from World Bank
diesel_fuelprice_tbl_df

Daily Diesel Fuel Price Data in India (2002-2020)
road_population_tbl_df

India Road and Population Data by State
smartphones5G_tbl_df

5G Smartphones Available in India (2022)
get_india_unemployment

Get India's Unemployment Rate from World Bank
hospitalcount_tbl_df

Hospitals Count in India - Statewise
get_india_cpi

Get India's Consumer Price Index (2010 = 100) from World Bank
rainfall_tbl_df

Rainfall in India (1901-2021)
petrol_prices_tbl_df

Petrol Prices in India
petrol_fuelprice_tbl_df

Daily Petrol Fuel Price Data in India (2002-2020)
indianPopulation_tbl_df

Indian Population (Census and Projections) by States
get_india_life_expectancy

Get India's Life Expectancy at Birth from World Bank
get_india_population

Get India's Total Population from World Bank
get_india_literacy_rate

Get India's Adult Literacy Rate from World Bank
get_india_hospital_beds

Get India's Hospital Beds (per 1,000 people) from World Bank
view_datasets_IndiAPIs

View Available Datasets in IndiAPIs
startup_funding_tbl_df

Indian Startup Funding
DataScienceJobs_tbl_df

Data Science Jobs in India
BombayPlague1905_df

Weekly deaths from bubonic plague in Bombay in 1905-06
BurdwanRiceYield_df

Yearly Rice Yield Data in Burdwan District, West Bengal
GDPIndia_tbl_df

India GDP (1960-2022)
BirthDeathRates_df

Changes in Human Birth and Death Rates in India Over the 20th Century
GoldPricesIndia_df

Gold Prices Across Six Indian Cities from February 2022 to January 2023
ButterflySpecies_df

Distribution of Butterfly Species in India
BurdwanWeather_df

Weekly Weather Data for Rice Growing Season in Burdwan District
DelhiPotatoPrices_ts

Monthly Average Potato Price of Delhi Market (India)
CyberCrime_India_tbl_df

CyberCrime in India
IndiaLandReforms_df

Politics and Land Reforms in India
IPLCricket_tbl_df

Cricket data set for different seasons of Indian Premier League
India_census2011_tbl_df

Indian Districts Population Data (2011 Census)
India_Companies_tbl_df

Indian Companies in the Fortune Global 500
IndiAPIs

IndiAPIs: Access Indian Data via Public APIs and Curated Datasets
WestBengalPop_tbl_df

West Bengal Population, Sex-Ratio, and Literacy Data (2011)
IndiaPopulation_dt

List of places, abbreviations, and populations in India
Unicorn_startups_tbl_df

Indian Unicorn Startups 2023