View source: R/open-api-helpers.R
| get_consumption | R Documentation |
Data on French electricity consumption in real time. Forecasts are also available, they include electricity losses on the grid but do not include pumping consumption of waterworks.
get_consumption(
resource = c("short_term", "weekly_forecasts", "annual_forecasts"),
type = c("REALISED", "ID", "D-1", "D-2"),
start_date = NULL,
end_date = NULL,
token = NULL,
raw = FALSE
)
resource |
Which ressource to use between |
type |
Forecast type of consumption, one or several between 'REALISED', 'ID', 'D-1', 'D-2'. |
start_date |
Optional, starting date to filter results. |
end_date |
Optional, ending date to filter results. |
token |
Token obtained with |
raw |
Return output from |
a data.table or a list if raw = TRUE.
## Not run:
# First you need a token
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)
)
# Then you can retrieve consumption data
consumption <- get_consumption("short_term", token = token)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.