Function to download data from GIE's AGSI+/ALSI+ API in bulk
gie_batchload(
countries,
companies = NULL,
facilities = NULL,
from = NULL,
to = NULL,
date = NULL,
size = 30,
timeout = 3,
database = "agsi",
verbose = FALSE,
apikey = Sys.getenv("GIE_APIKEY")
)
A data.frame with results
Character. Specify the countries of interest as two-digit
country codes (e.g., 'DE', 'IE').
Must be of length one (i.e., one country) if you want to specify multiple
companies and/or multiple facilities.
A character vector of company EIC codes to get data from.
Must be of length one (i.e., one company) if you want to specify multiple
facilities.
A character vector of facility EIC codes to get data from.
Character. Specify the start of the time span you are
interested in downloading (format: YYYY-MM-DD).
Character. Specify the end of the time span you are
interested in downloading (format: YYYY-MM-DD).
Character. If you want to have data only for one date.
If you set 'date', you cannot set the 'from' and/or 'to' parameters
(format: YYYY-MM-DD).
Integer. The number of results per page.
Numeric. If the amount of pages of your request exceeds 60, a timeout
will be enforced to prevent the API from timing out. Defaults to 3 seconds, any
values must be set in seconds, too.
Character. The type of API you want to address ('agsi' or 'alsi').
Logical. Prints information on function progress to the console (default: FALSE).
Character. Your personal API key.
if (FALSE) {
gie_batchload(countries = c("DE", "AT", "FR"), date = "2022-04-01")
}
Run the code above in your browser using DataLab