An R package for querying the UK Open Banking (Open Data) API
-
Create an R client for the OpenBanking (OpenData) API
-
Extract raw data from the API using convenient functions
From CRAN:
install.packages("openbankeR")
From GitHub:
library(devtools)
install_github("nik01010/openbankeR")
R package functions:
Function | Description | Input | Output |
---|---|---|---|
CreateOpenBankingClient | Creates a client for calling the API | Optional user-defined settings | OpenBankingClient object with queries |
Once the client has been set-up, the following queries can be used:
Query | Description | Input | Output |
---|---|---|---|
GetAvailableBanks | Get a list of banks that report the API | n/a | List of available banks |
GetAvailableInstruments | Get a list of instruments reported via the API | n/a | List of available instruments |
GetRawData | Get raw data using the API for a given bank and instrument | Bank name and instrument | Requested raw data |
Create a new client for querying the API
library(openbankeR)
openBankingClient <- openbankeR::CreateOpenBankingClient()
bankDetails <- openBankingClient$BankDetails
View(bankDetails)
Get a list of banks that report the API
availableBanks <- openBankingClient$GetAvailableBanks()
availableBanks
# [1] "Adam & Company" "Allied Irish Bank (GB)" "Bank of Ireland (UK)" "Bank of Scotland"
# [5] "Barclays Bank" "Coutts" "Danske Bank" "Esme"
# [9] "First Trust Bank" "Halifax" "HSBC Group" "Lloyds Bank"
# [13] "Nationwide Building Society" "NatWest" "Royal Bank of Scotland" "Santander UK"
# [17] "Ulster Bank" "Clydesdale Bank PLC" "Yorkshire Bank" "VM"
Get a list of instruments reported via the API
availableInstruments <- openBankingClient$GetAvailableInstruments()
availableInstruments
# [1] "business-current-accounts" "personal-current-accounts" "unsecured-sme-loans" "atms" "branches"
# [6] "commercial-credit-cards"
Get raw data using the API for a given bank and instrument
bankName <- "HSBC Group"
instrument <- "branches"
rawData <- openBankingClient$GetRawData(
bankName = bankName,
instrument = instrument
)
View(rawData)
Use the below commands to find additional documentation about the package
??openbankeR
??openbankeR::CreateOpenBankingClient
Raw data provided by the API can be a nested structure and may need to be unnested for some types of analysis.