Skip to contents

License: MIT

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.

IndiAPIs Functions

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

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)