get_request {bdl}R Documentation

Get JSON response from BDL API

Description

Retrieve data from BDL API in JSON format.

Usage

get_request(dir, id, filters = NULL, ...)

Arguments

dir

A directory of the dataset.

id

A name for the dataset of interested.

filters

A named list of filters. Names of list objects are bdl filter names and values are vectors with specified filter values. If NULL (default) the whole dataset is returned. See API documentation for more on filters and limitations per query.

...

Other arguments passed on to GET. For example a proxy parameters, see details.

Details

Data to retrieve from The BDL Web Services can be specified with filters. If no specific filters required, it's recommended to use data query like get_data_by_unit_locality, than to use get_request directly.

To use a proxy to connect, a use_proxy can be passed to GET. For example get_request(id, filters, config = httr::use_proxy(url, port, username, password)).

Value

A JSON raw data.

Examples

   # get_request(dir = "data/By-Variable", id = "3643")
   # get_request(dir = "data/By-Unit", id = "023200000000", filters = list(year  = c("2000","2010"), 
   #             var-Id" = c("2137","148190")))
   # get_request(dir = "data/By-Variable", id = "3643", filters = list(year = c("2000","2010"), 
   #             unit-Level" = 2, lang = "en"))

[Package bdl version 1.0.3 Index]