Access data from RTE data portal

Project Status: WIP – Initial development is in progress, but there
has not yet been a stable, usable release suitable for the
public. Travis build


RTE, the french electricity transmission system operator, provides access to various data through an API on its data portal. You can retrieve those data with

Installation (from Github) :


# or


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 client 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
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 .Renviron with set_key.



Data on French electricity consumption in real time, with forecast :

short_term <- get_consumption("short_term", type = c("REALISED", "D-1"))


Physical flows

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, by_country = TRUE)

Actual generation

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 production units

active_units <- retrieve_active_units()

or see on a map :

autoplot(active_units, map = TRUE)

Generation installed capacities

inst_cap <- get_open_api(
  api = "generation_installed_capacities",
  resource = "capacities_per_production_unit"


dreamRs/ documentation built on April 4, 2020, 8:12 p.m.