With gas storage data gaining increased attention due to the consequences of Russia’s war against Ukraine, I have written a package to access the API of Gas Infrastructure Europe (GIE).
It has not been until Russia’s brutal attack on Ukraine in February of 2022 that daily data on gas storage facilities in Europe would be an interesting topic to deal with for a broader public. Yet, in response to the sanctions put in place by the European Union, Russia has reduced the flow of natural gas to EU countries (thereby exploiting their huge dependency on Russian gas, probably for political reasons). In many countries, it is now questionable as to whether the gas storage facilities will hold enough gas to get through winter time.
This is why politicians, journalists, managers and statisticians are now in need for high frequency, reliable data on gas storage facilities. In Europe, they are provided by Gas Infrastructure Europe (GIE). For their AGSI+/ALSI+ transparency platform they offer an API that provides all available data on gas storage, the most important data being filling level as well as inflow and outflow.
Right after people started searching for gas storage data with the start of the war, GIE changed the architecture of their API fundamentally, introducing pagination and updating most endpoints and parameters. Since there was no pre-existing R package that could work with the new architecture, I decided to write it myself. As a result, {gie}
was published on CRAN in July 2022. Here, I want to give a short overview of what it offers:
The first step in a possible workflow would be to fetch the metadata of the available gas storage companies and their facilities in a given region or country. In this example, I will fetch all gas storage companies in Germany including their facilities, using the first of three main functions of the package, get_gielisting()
:
storage <- gie::gie_listing(region = "Europe",
country = "Germany",
facilities = TRUE)
head(storage, n = 5)
# A tibble: 5 × 10
facility_eic facility_name facility_type operational_start_date
<chr> <chr> <chr> <chr>
1 21Z000000000271O UGS Rehden Storage Faci… 2011-01-01
2 21W0000000001148 UGS Jemgum H … Storage Faci… 2011-01-01
3 21W0000000001261 VSP NORD (Reh… Storage Group 2019-01-01
4 21W0000000000184 UGS Wolfersbe… Storage Faci… 2011-01-01
5 21W0000000001083 UGS Berlin (d… Storage Faci… 2011-01-01
# ℹ 6 more variables: company_eic <chr>, country <chr>,
# country_code <chr>, company_shortname <chr>, company_name <chr>,
# operational_end_date <chr>
Based on this information, we can then use the function get_gie()
to download the data from AGSI+/ALSI+ (ALSI+ for liquefied natural gas is not yet supported for the new API architecture). From the data set above we see that the unique ID (EIC) of the company “astora” is 21X000000001160J
, we can use that now (from the data set above we, too, get the EIC of the storage unit in Rehden):
data <- gie::gie_load(country = "DE",
company = "21X000000001160J",
facility = "21Z000000000271O",
from = "2022-01-01",
to = "2022-01-05")
head(data)
# A tibble: 5 × 20
name code url longitude latitude type updatedAt gasDayStart
<chr> <chr> <chr> <dbl> <dbl> <dbl> <chr> <date>
1 UGS Rehd… 21Z0… 21Z0… 8.49 52.6 NA 2022-01-… 2022-01-01
2 UGS Rehd… 21Z0… 21Z0… 8.49 52.6 NA 2022-01-… 2022-01-02
3 UGS Rehd… 21Z0… 21Z0… 8.49 52.6 NA 2022-01-… 2022-01-03
4 UGS Rehd… 21Z0… 21Z0… 8.49 52.6 NA 2022-01-… 2022-01-04
5 UGS Rehd… 21Z0… 21Z0… 8.49 52.6 NA 2022-01-… 2022-01-05
# ℹ 12 more variables: gasInStorage <dbl>, injection <dbl>,
# withdrawal <dbl>, netWithdrawal <dbl>, workingGasVolume <dbl>,
# injectionCapacity <dbl>, withdrawalCapacity <dbl>,
# contractedCapacity <dbl>, availableCapacity <dbl>, status <chr>,
# trend <dbl>, full <dbl>
The last of three main functions is get_gie2()
and is a generalised version of get_gie()
that allows you to download data for multiple countries, companies or facilities at once so you do not have to loop over get_gie()
yourself:
data2 <- gie::gie_batchload(countries = c("DE", "NL", "AT"),
date = "2022-07-01")
head(data2)
# A tibble: 3 × 20
name code url updatedAt gasDayStart gasInStorage consumption
<chr> <chr> <chr> <chr> <date> <dbl> <dbl>
1 Germany DE DE 2023-12-… 2022-07-01 150. 889.
2 Netherla… NL NL 2023-07-… 2022-07-01 75.6 312.
3 Austria AT AT 2022-11-… 2022-07-01 43.2 91
# ℹ 13 more variables: consumptionFull <dbl>, injection <dbl>,
# withdrawal <dbl>, netWithdrawal <dbl>, workingGasVolume <dbl>,
# injectionCapacity <dbl>, withdrawalCapacity <dbl>,
# contractedCapacity <dbl>, availableCapacity <dbl>,
# coveredCapacity <dbl>, status <chr>, trend <dbl>, full <dbl>
Note that due to the design of the API the functionality of get_gie2()
is - as of yet - a tiny bit complicated: You can specify multiple countries and get the data on the country level. Once you want to get data on companies, you can only specify one country, and all EIC codes provided must be of this country’s origin. The same holds for facilities: You can get data for mulitple facilities at once, but the country and company EIC must be of length one.
Case 1: Country + companies
data3 <- gie::gie_batchload(countries = "DE",
companies = c("21X000000001160J",
"37X0000000000151"),
date = "2022-01-01")
head(data3)
# A tibble: 2 × 19
name code publication_link transparency_template url updatedAt
<chr> <chr> <dbl> <dbl> <chr> <chr>
1 astora… 21X0… NA NA 21X0… 2022-01-…
2 bayern… 37X0… NA NA 37X0… 2022-01-…
# ℹ 13 more variables: gasDayStart <date>, gasInStorage <dbl>,
# injection <dbl>, withdrawal <dbl>, netWithdrawal <dbl>,
# workingGasVolume <dbl>, injectionCapacity <dbl>,
# withdrawalCapacity <dbl>, contractedCapacity <dbl>,
# availableCapacity <dbl>, status <chr>, trend <dbl>, full <dbl>
Case 2: Company + facilities
data4 <- gie::gie_batchload(countries = "DE",
companies = "21X000000001160J",
facilities = c("21Z000000000271O",
"21W0000000001148"),
date = "2022-01-01")
head(data4)
# A tibble: 2 × 20
name code url longitude latitude type updatedAt gasDayStart
<chr> <chr> <chr> <dbl> <dbl> <dbl> <chr> <date>
1 UGS Rehd… 21Z0… 21Z0… 8.49 52.6 NA 2022-01-… 2022-01-01
2 UGS Jemg… 21W0… 21W0… 7.28 53.3 NA 2022-01-… 2022-01-01
# ℹ 12 more variables: gasInStorage <dbl>, injection <dbl>,
# withdrawal <dbl>, netWithdrawal <dbl>, workingGasVolume <dbl>,
# injectionCapacity <dbl>, withdrawalCapacity <dbl>,
# contractedCapacity <dbl>, availableCapacity <dbl>, status <chr>,
# trend <dbl>, full <dbl>
Lastly, I hope this package is of use to you and if you have any query or suggestion, do not hesitate and hop over to Github and create an issue.