Title: | Client for Central Bank APIs |
---|---|
Description: | A client for retrieving data and metadata from major central bank APIs. It supports access to the 'Bundesbank SDMX Web Service API' (<https://www.bundesbank.de/en/statistics/time-series-databases/help-for-sdmx-web-service/web-service-interface-data>), the 'Swiss National Bank Data Portal' (<https://data.snb.ch/en>), and the 'European Central Bank Data Portal API' (<https://data.ecb.europa.eu/help/api/overview>). |
Authors: | Maximilian Mücke [aut, cre] |
Maintainer: | Maximilian Mücke <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.6.0.9000 |
Built: | 2025-03-03 22:20:34 UTC |
Source: | https://github.com/m-muecke/bbk |
Returns Bundesbank data for a given flow and key
bbk_data( flow, key = NULL, start_period = NULL, end_period = NULL, first_n = NULL, last_n = NULL )
bbk_data( flow, key = NULL, start_period = NULL, end_period = NULL, first_n = NULL, last_n = NULL )
flow |
( |
key |
( |
start_period |
(
|
end_period |
( |
first_n |
( |
last_n |
( |
A data.table::data.table()
with the requested data.
Other data:
bbk_series()
,
ecb_data()
,
snb_data()
# fetch all data for a given flow and key bbk_data("BBSIS", "D.I.ZAR.ZI.EUR.S1311.B.A604.R10XX.R.A.A._Z._Z.A") # fetch data for multiple keys bbk_data("BBEX3", c("M.ISK.EUR", "USD.CA.AC.A01")) # specified period (start date-end date) for daily data bbk_data( "BBSIS", "D.I.ZAR.ZI.EUR.S1311.B.A604.R10XX.R.A.A._Z._Z.A", start_period = "2020-01-01", end_period = "2020-08-01" ) # or only specify the start date bbk_data( "BBSIS", "D.I.ZAR.ZI.EUR.S1311.B.A604.R10XX.R.A.A._Z._Z.A", start_period = "2024-04-01" )
# fetch all data for a given flow and key bbk_data("BBSIS", "D.I.ZAR.ZI.EUR.S1311.B.A604.R10XX.R.A.A._Z._Z.A") # fetch data for multiple keys bbk_data("BBEX3", c("M.ISK.EUR", "USD.CA.AC.A01")) # specified period (start date-end date) for daily data bbk_data( "BBSIS", "D.I.ZAR.ZI.EUR.S1311.B.A604.R10XX.R.A.A._Z._Z.A", start_period = "2020-01-01", end_period = "2020-08-01" ) # or only specify the start date bbk_data( "BBSIS", "D.I.ZAR.ZI.EUR.S1311.B.A604.R10XX.R.A.A._Z._Z.A", start_period = "2024-04-01" )
Retrieval of the metadata stored in the Bundesbank's time series database. Access via the SDMX Web Service API of the Bundesbank.
bbk_metadata(type, id = NULL, lang = c("en", "de"))
bbk_metadata(type, id = NULL, lang = c("en", "de"))
type |
( |
id |
( |
lang |
( |
A data.table::data.table()
with the queried metadata.
The columns are:
id |
The id of the metadata |
name |
The name of the metadata |
Other metadata:
ecb_metadata()
bbk_metadata("datastructure") bbk_metadata("dataflow", "BBSIS") bbk_metadata("codelist", "CL_BBK_ACIP_ASSET_LIABILITY") bbk_metadata("concept", "CS_BBK_BSPL")
bbk_metadata("datastructure") bbk_metadata("dataflow", "BBSIS") bbk_metadata("codelist", "CL_BBK_ACIP_ASSET_LIABILITY") bbk_metadata("concept", "CS_BBK_BSPL")
Returns the Bundesbank time serie that is found with the specified time series key
bbk_series(key)
bbk_series(key)
key |
( |
A data.table::data.table()
with the requested data.
bbk_data()
for an endpoint with more options.
Other data:
bbk_data()
,
ecb_data()
,
snb_data()
bbk_series("BBEX3.M.DKK.EUR.BB.AC.A01") bbk_series("BBAF3.Q.F41.S121.DE.S1.W0.LE.N._X.B") bbk_series("BBBK11.D.TTA000")
bbk_series("BBEX3.M.DKK.EUR.BB.AC.A01") bbk_series("BBAF3.Q.F41.S121.DE.S1.W0.LE.N._X.B") bbk_series("BBBK11.D.TTA000")
Returns ECB data for a given flow and key
ecb_data( flow, key = NULL, start_period = NULL, end_period = NULL, first_n = NULL, last_n = NULL )
ecb_data( flow, key = NULL, start_period = NULL, end_period = NULL, first_n = NULL, last_n = NULL )
flow |
( |
key |
( |
start_period |
(
|
end_period |
( |
first_n |
( |
last_n |
( |
https://data.ecb.europa.eu/help/api/data
Other data:
bbk_data()
,
bbk_series()
,
snb_data()
# fetch US dollar/Euro exchange rate ecb_data("EXR", "D.USD.EUR.SP00.A") # fetch data for multiple keys ecb_data("EXR", c("D.USD", "JPY.EUR.SP00.A"))
# fetch US dollar/Euro exchange rate ecb_data("EXR", "D.USD.EUR.SP00.A") # fetch data for multiple keys ecb_data("EXR", c("D.USD", "JPY.EUR.SP00.A"))
Fetch the latest or historical Euro foreign exchange reference rates from the European Central Bank.
ecb_euro_rates(x = c("latest", "history"))
ecb_euro_rates(x = c("latest", "history"))
x |
( |
Note you can achieve the same by calling the ecb_data()
function with the right
parameters for each currency.
The reference rates are usually updated at around 16:00 CET every working day, except on TARGET closing days.
They are based on the daily concertation procedure between central banks across Europe, which normally takes place around 14:10 CET. The reference rates are published for information purposes only. Using the rates for transaction purposes is strongly discouraged.
A data.table::data.table()
with the reference rates.
ecb_euro_rates()
ecb_euro_rates()
Retrieval of the metadata stored in the ECB's time series database. Access via the SDMX Web Service API of the ECB
ecb_metadata(type, agency = NULL, id = NULL)
ecb_metadata(type, agency = NULL, id = NULL)
type |
( |
agency |
( |
id |
( |
A data.table::data.table()
with the queried metadata.
The columns are:
agency |
The agency of the metadata |
id |
The id of the metadata |
name |
The name of the metadata |
https://data.ecb.europa.eu/help/api/metadata
Other metadata:
bbk_metadata()
ecb_metadata("datastructure") ecb_metadata("datastructure", "ECB") ecb_metadata("datastructure", "ECB", "ECB_EXR1") ecb_metadata("datastructure", id = "ECB_EXR1")
ecb_metadata("datastructure") ecb_metadata("datastructure", "ECB") ecb_metadata("datastructure", "ECB", "ECB_EXR1") ecb_metadata("datastructure", id = "ECB_EXR1")
Returns Swiss National Bank (SNB) data for a given id
snb_data(id, start_date = NULL, end_date = NULL, lang = c("en", "de"))
snb_data(id, start_date = NULL, end_date = NULL, lang = c("en", "de"))
id |
( |
start_date |
( |
end_date |
( |
lang |
( |
A data.table::data.table()
with the requested data.
Other data:
bbk_data()
,
bbk_series()
,
ecb_data()
snb_data("rendopar") # or filter for date range snb_data("rendopar", "2020-01-01", "2020-12-31")
snb_data("rendopar") # or filter for date range snb_data("rendopar", "2020-01-01", "2020-12-31")