https://github.com/krose/entsoeapi
R wrapper for ENTSO-E Transparency Platform API — electricity prices, generation, load, cross-border flows
https://github.com/krose/entsoeapi
coal congestion demand electricity energy entso-e entsoe europe gas generation imbalance installations intraday load outages power prices solar supply wind
Last synced: 2 months ago
JSON representation
R wrapper for ENTSO-E Transparency Platform API — electricity prices, generation, load, cross-border flows
- Host: GitHub
- URL: https://github.com/krose/entsoeapi
- Owner: krose
- License: other
- Created: 2020-03-19T13:55:01.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2026-03-25T19:18:00.000Z (3 months ago)
- Last Synced: 2026-03-26T19:39:30.600Z (3 months ago)
- Topics: coal, congestion, demand, electricity, energy, entso-e, entsoe, europe, gas, generation, imbalance, installations, intraday, load, outages, power, prices, solar, supply, wind
- Language: HTML
- Homepage: https://krose.github.io/entsoeapi/
- Size: 11 MB
- Stars: 25
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# entsoeapi {width="120" height="120"}
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)\
[](https://github.com/krose/entsoeapi/actions/workflows/lint-project.yml)\
[](https://github.com/krose/entsoeapi/actions/workflows/R-CMD-check.yml)\
[](https://github.com/krose/entsoeapi/actions/workflows/test-coverage.yml)
The goal of `entsoeapi` package is to create an easy wrapper around the ENTSO-E [API](https://documenter.getpostman.com/view/7009892/2s93JtP3F6)'s data and transform them to tabular format without effort. (The downloadable data are available interactively on the ENTSO-E [transparency platform](https://transparency.entsoe.eu/) website as well.)
The package helps with
- displaying the queried endpoint URL to easier double check
- upfront checking of function arguments' validity to avoid useless API calls
- query pagination, by allowing the user to not worry about it at all since the package does all necessary requests
- unpacking compressed file responses
- caching data to enhance processing speed
- converting XML structures to tabular ones
- composing consistent and detailed outputs
- providing related, but not API accessible data (for instance: business_types)
- automatic assigning definitions to codes
- calculating and adding timestamps to data points (the response xml does not contain such information explicitly)
------------------------------------------------------------------------
- Already available ENTSO-E API endpoints:
- MARKET
- implicit_offered_transfer_capacities (11.1)
- explicit_offered_transfer_capacities (11.1.A)
- continuous_offered_transfer_capacities (11.1)
- flow_based_allocations (11.1.B)
- auction_revenue (12.1.A)
- total_nominated_capacity (12.1.B)
- already_allocated_total_capacity (12.1.C)
- day_ahead_prices (12.1.D)
- net_positions (12.1.E)
- congestion_income (12.1.E)
- allocated_transfer_capacities_3rd_countries (12.1.H)
- LOAD
- load_actual_total (6.1.A)
- load_day_ahead_total_forecast (6.1.B)
- load_week_ahead_total_forecast (6.1.C)
- load_month_ahead_total_forecast (6.1.D)
- load_year_ahead_total_forecast (6.1.E)
- load_year_ahead_forecast_margin (8.1)
- GENERATION
- gen_installed_capacity_per_pt (14.1.A)
- the gen_installed_capacity_per_pu (14.1.B)
- gen_day_ahead (14.1.C)
- gen_wind_solar_forecasts (14.1.D)
- gen_per_gen_unit (16.1.A)
- gen_per_prod_type (16.1.B&C)
- the gen_storage_mean_filling_rate (16.1.D)
- TRANSMISSION
- expansion_and_dismantling_project (9.1) (no data available on the ENTSO-E API yet, as of 24 March 2026)
- intraday_cross_border_transfer_limits (11.3)
- forecasted_transfer_capacities (11.1.A)
- day_ahead_commercial_sched (12.1.F)
- total_commercial_sched (12.1.F)
- cross_border_physical_flows (12.1.G)
- redispatching_internal (13.1.A)
- redispatching_cross_border (13.1.A)
- countertrading (13.1.B)
- costs_of_congestion_management (13.1.C)
- OUTAGES
- outages_cons_units (7.1.A&B)
- outages_fallbacks (IFs IN 7.2, mFRR 3.11, aFRR 3.10)
- outages_transmission_grid (10.1.A&B)
- outages_offshore_grid (10.1.C)
- outages_gen_units (15.1.A&B)
- outages_prod_units (15.1.C&D)
- outages_both (15.1.A&B + 15.1.C&D)
- BALANCING
- exchanged_volumes (aFRR 3.16, mFRR 3.17)
- netted_volumes (IFs IN 3.10)
- elastic_demands (IF mFRR 3.4)
- balancing_border_cap_limit (IFs 4.3 & 4.4)
- exchanged_volumes_per_border (3.10, 3.16 & 3.17)
- netted_volumes_per_border (3.10, 3.16 & 3.17) (no data available on the ENTSO-E API yet, as of 24 March 2026)
- hvdc_link_constrains (4.5) (no data available on the ENTSO-E API yet, as of 24 March 2026)
- changes_to_bid_availability (mFRR 9.9, aFRR 9.6&9.8) (no data available on the ENTSO-E API yet, as of 24 March 2026)
- current_balancing_state (12.3.A)
- balancing_energy_bids (12.3.B&C) (no data available on the ENTSO-E API yet, as of 24 March 2026)
- (12.3.D)
- aggregated_balancing_energy_bids (12.3.E)
- procured_balancing_capacity (12.3.F)
- allocation_of_cross_zonal_balancing_cap (12.3.H&I) (no data available on the ENTSO-E API yet, as of 24 March 2026)
- contracted_reserves (17.1.B&C)
- activated_balancing_prices (17.1.F)
- imbalance_prices (17.1.G)
- imbalance_volumes (17.1.H)
- financial_expenses_and_income (17.1.I)
- fcr_total_capacity (187.2)
- rr_and_frr_actual_capacity (188.4 & 189.3)
- shares_of_fcr_capacity (187.2)
- sharing_of_rr_and_frr_capacity (SO GL 190.1) (no data available on the ENTSO-E API yet, as of 24 March 2026)
Be aware, that not all API endpoints are implemented in this package, and not every endpoint provides data.
If you would like to use an unimplemented endpoint, please submit an [issue](https://github.com/krose/entsoeapi/issues/new/choose) and we'll do our best to resolve it.
If the endpoint is already implemented, but the related function gives back an empty table, then check the response XML in a browser using the request URL displayed in the console just after issuing the function call. Another verification option might be to check the response on the [Entsoe-e Transparency Platform](https://transparency.entsoe.eu/).
In case of beta test version functions there may be unique quirks which are not handled yet. So please, compare the resulting tables to the data fn the [Entsoe-e Transparency Platform](https://transparency.entsoe.eu/).
\
IMPORTANT!\
Since the underlying engine has fairly been standardized with the introduction of version 0.7.0.0, there are significant (breaking) changes between the 0.7.0.0 and the previous versions.
## Installation
You can install the development version of entsoeapi from [GitHub](https://github.com/krose/entsoeapi) with:
```{r install, eval=FALSE}
if (!require("devtools", quietly = TRUE)) install.packages("devtools", quiet = TRUE)
devtools::install_github(repo = "krose/entsoeapi", ref = "main")
```
## Security token
Read the related ENTSO-E Transparency Platform documentation [here](https://transparencyplatform.zendesk.com/hc/en-us/articles/12845911031188-How-to-get-security-token) about how to get a security token. You should also create a `.Renviron` file in your working directory with a security token and call it `ENTSOE_PAT`.
```{r edit renviron, eval=FALSE}
if (!require("usethis", quietly = TRUE)) install.packages("usethis", quiet = TRUE)
usethis::edit_r_environ()
```
`ENTSOE_PAT = "your_security_token"`
## Examples
You use the eic codes to get the data. Let’s try to find the eic code for Germany.
```{r example 1}
if (!require("dplyr", quietly = TRUE)) install.packages("dplyr", quiet = TRUE)
entsoeapi::all_approved_eic() |>
dplyr::filter(eic_long_name == "Germany") |>
dplyr::glimpse()
```
For some of the data you need to translate the generation codes.
```{r example 2}
if (!require("knitr", quietly = TRUE)) install.packages("knitr", quiet = TRUE)
entsoeapi::asset_types |>
head(n = 12L) |>
knitr::kable(format = "html")
```
Let’s get the demand of 2020-01-01 in Germany.
```{r example 3}
if (!require("dplyr", quietly = TRUE)) install.packages("dplyr")
entsoeapi::load_actual_total(
eic = "10Y1001A1001A83F",
period_start = lubridate::ymd("2020-01-01", tz = "CET"),
period_end = lubridate::ymd("2020-01-02", tz = "CET")
) |>
dplyr::glimpse()
```
This is basically how all the functions work, so let’s try to get the production data too.
```{r example 4}
if (!require("dplyr", quietly = TRUE)) install.packages("dplyr")
entsoeapi::gen_per_prod_type(
eic = "10Y1001A1001A83F",
period_start = lubridate::ymd("2020-01-01", tz = "CET"),
period_end = lubridate::ymd("2020-01-02", tz = "CET"),
gen_type = NULL,
tidy_output = TRUE
) |>
dplyr::glimpse()
```
## Code of Conduct
## Code of Conduct
Please note that the entsoeapi project is released with a [Contributor Code of Conduct](https://krose.github.io/entsoeapi/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.