get_open_api: Retrieve data from an open API

View source: R/get_open_api.R

get_open_apiR Documentation

Retrieve data from an open API

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

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

## 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 Oct. 6, 2022, 6:32 p.m.