get_open_api: Retrieve data from an open API

Description Usage Arguments Value Examples

Description

Several APIs are available, create an application and attach APIs to it, this function allows to retrieve data from any API, you'll need its name and the name of the resource (informations available on the page of the API on https://data.rte-france.com).

Usage

1
2
get_open_api(api, resource, start_date = NULL, end_date = NULL,
  q = list(), token = NULL, raw = FALSE)

Arguments

api

Name of main API.

resource

Resource to use in the API.

start_date

Optional, starting date to filter results, if used, end_date must be set as well.

end_date

Optional, ending date to filter results.

q

Additional parameters to query the API.

token

Token obtained with get_token.

raw

Return output from fromJSON.

Value

a data.table or a list if raw = TRUE.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 

set_key(
  api = "physical_flow",
  key = "BASE64_KEY"
)

# Get physical flows between cross border country
physfl <- get_open_api(api = "physical_flow", resource = "physical_flows")


## End(Not run)

dreamRs/rte.data documentation built on June 18, 2019, 8:02 a.m.