bmrsIndoItsdo {ukgasapi} | R Documentation |
BMRS Initial Demand Outturn API Service
Description
This function connects to the Elexon's BMRS API to retrieve Initial Demand Outturn (INDO) and Initial Transmission System Demand Out-Turn (ITSDO) data. Internet connection must be available.
Usage
bmrsIndoItsdo(
fromdate,
todate,
apikey,
batchsize = 60,
apiurl = "https://api.bmreports.com/BMRS/INDOITSDO/v1"
)
Arguments
fromdate |
A character object specifying the start date. Date is inclusive. |
todate |
A character object specifying the end date. Date is inclusive. |
apikey |
A character object specifying the API key. This is also known as scripting key on Elexon's website. |
batchsize |
An interger value indicating the batch size of each API call. (Number of days included in one call) |
apiurl |
A character object which points to the BMRS INDO/ITSDO API. Under most circumstances users do not have to change this. Default to 'https://api.bmreports.com/BMRS/INDOITSDO/v1' |
Details
The function submits a request to the API. The response is in CSV format which function will parse internally and returns a R dataframe object. The data returned by this API is identical to the data displayed on BMRS dashboard https://www.bmreports.com/bmrs/?q=demand/initialdemandoutturn.
Value
A dataframe object containing API response data.
Author(s)
Timothy Wong, timothy.wong@hotmail.co.uk
References
BMRS API and Data Push User Guide
https://www.elexon.co.uk/documents/training-guidance/bsc-guidance-notes/bmrs-api-and-data-push-user-guide-2/Scripting Guide
https://www.elexonportal.co.uk/scriptingInitial Demand Outturn (INDO)
https://www.bmreports.com/bmrs/?q=help/glossary#INDOInitial Transmission System Demand Out-Turn (ITSDO)
https://www.bmreports.com/bmrs/?q=help/glossary#ITSDO
Examples
## Not run:
# Invoke the API (requires internet connection at this step)
response <- bmrsIndoItsdo(fromdate = "2020-01-01",
todate = "2020-01-10",
apikey = "your api key goes here")
# Visualise the results on a chart
library(ggplot2)
ggplot(response, aes(x=publishtime, y=value,colour=recordtype)) +
geom_line()
## End(Not run)