Skip to contents

R Package to access Open Government Data from India.

Introduction

This package provides easy access to the API provided by Open Government Data Platform - India to download datasets from R. Here’s the list of Datasets available through API.

Prerequisite

  • To use this package to download data from Open Government Data Platform - India, you’ll first need to signup on the portal and obtain an API key. (API key is a 32 characters long hexadecimal string).
  • You can either set it as a temporary global variable or a permanent global variable.
    1. Temporary variable approach: when you make your first API call you’ll be asked to provide this API key.
    2. Permanent variable approach: You can permanently store this key in your .Renviron file as OGDINDIA_API_KEY (preferred). For more info see ?ogdindia_api_key. You can also refer to “Appendix: API key best practices” for httr package on cran for an example on how to set a global variable in .Renviron file.

Installation

This package is currently available on github, you can install the latest development version as follows:

library(devtools)
devtools::install_github("steadyfish/ogdindiar")

If you intend to build the vignette yourself, you’ll first need to set the OGDINDIA_API_KEY as shown in Prerequisite section above. You can then install the package as follows:

library(devtools)
devtools::install_github("steadyfish/ogdindiar", build_vignettes = TRUE) 

Usage

For usage, check out these vignettes - Introduction and Search functionality. Otherwise, you can run the following, if you have installed the package with build_vignettes = TRUE option -

vignette("basic-usage-vignette")
vignette("search-functionality")

Credits

Encouragement and support from Leo Lahti from rOpenGov made the package development a lot easier.