Access data from RTE data portal
RTE, the french electricity transmission system operator, provides
access to various data through an API on its data
portal. You can retrieve those data
Installation (from Github) :
source("https://install-github.me/dreamRs/rte.data") # or devtools::install_github("dreamRs/rte.data")
To access the API, you need to create an account, or login if you have one.
Once logged, you can subscribe (create an application) to the desired
API (each APIs must be subscribed individualy), you’ll obtain an
id and a
client secret (or directly a base64 encoded key). Use those
to get a token :
# To create a token you can use id_client and id_secret id_client <- "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" id_secret <- "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX" token <- get_token( key = list(id_client = id_client, id_secret = id_secret) ) # or the base64 encoded key key <- "TGEgZGF0YXNjaWVuY2UgYXZlYyB1biBncmFuZCBS=" token <- get_token(key)
With this token, you can query the API. You need to generate a token every \~two hours, but you can use the same key each time.
So for future use, you can store your credentials in your
Data on French electricity consumption in real time, with forecast :
short_term <- get_consumption("short_term", type = c("REALISED", "D-1")) short_term autoplot(short_term)
Data about physical cross-border schedules detailing electricity flows actually transiting across the interconnection lines directly linking countries.
balance <- get_physical_flows(start_date = "2018-02-01", end_date = "2018-03-15") autoplot(balance)
autoplot(balance, by_country = TRUE)
Generation data aggregated by sector and produced per group (in MW) on an intradaily basis for net generation injected into the network.
prod_type_30 <- get_actual_generation( resource = "actual_generations_per_production_type", start_date = Sys.Date() - 30, end_date = Sys.Date() ) autoplot(prod_type_30, by_day = TRUE)
active_units <- retrieve_active_units() autoplot(active_units)
or see on a map :
autoplot(active_units, map = TRUE)
inst_cap <- get_open_api( api = "generation_installed_capacities", resource = "capacities_per_production_unit" ) autoplot(inst_cap)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.