Client for Central Bank APIs

A client for retrieving data and metadata from central bank APIs including 'Banco Central do Brasil' (BCB), 'Banco de España' (BdE), 'Banco de México' (Banxico), 'Banco de Portugal' (BdP), 'Bank for International Settlements' (BIS), 'Bank of Canada' (BoC), 'Bank of England' (BoE), 'Bank of Israel' (BoI), 'Bank of Japan' (BoJ), 'Banque de France' (BdF), 'Czech National Bank' (CNB), 'Deutsche Bundesbank' (BBk), 'European Central Bank' (ECB), 'National Bank of Poland' (NBP), 'Norges Bank' (NoB), 'Oesterreichische Nationalbank' (OeNB), 'Sveriges Riksbank' (SRb), and 'Swiss National Bank' (SNB).


bbk

R-CMD-check CRANstatus R-universeversion

bbk is minimal R client for the following APIs:

In the future, it may be extended to other central banks and financial institutions. Feel free to open an issue if you have a specific request.

Installation

You can install the released version of bbk from CRAN with:

install.packages("bbk")

And the development version from GitHub with:

# install.packages("pak")
pak::pak("m-muecke/bbk")

Usage

bbk functions are prefixed according to the central bank they access (bbk_, ecb_, snb_, bdp_, bis_, boe_, boi_, boj_, bde_, bdf_, bcb_, cnb_, nbp_, onb_, boc_, nob_, srb_) and follow the naming conventions of their respective APIs.

The typical workflow involves:

  1. Finding the time series identifier on the relevant central bank’s website
  2. Using the appropriate bbk function to retrieve the data
library(bbk)

# Deutsche Bundesbank - fetch 10 year daily yield curve
yield_curve = bbk_data(
  flow = "BBSIS",
  key = "D.I.ZAR.ZI.EUR.S1311.B.A604.R10XX.R.A.A._Z._Z.A",
  start_period = "2020-01-01"
)

Related work

  • BIS: R package for downloading data from the Bank for International Settlements (BIS).
  • BISdata: R package for downloading data from the Bank for International Settlements (BIS).
  • boe: R package for downloading data from the Bank of England (BoE).
  • BOJ: R package for downloading data from the Bank of Japan (BoJ).
  • SNBdata: R package for downloading data from the Swiss National Bank (SNB).
  • bundesbank: R scripts for downloading time-series data from the Bundesbank.
  • czechrates: R package for Czech National Bank (CNB) foreign exchange and interest rates.
  • ecb: R interface to the European Central Bank’s Statistical Data Warehouse (SDW) API.
  • oenb: R package for accessing the OeNB’s API.
  • pdfetch: R package for downloading economic and financial time series from public sources.
  • rbcb: R interface to the Banco Central do Brasil (BCB) web services.
  • rnbp: R package for accessing the National Bank of Poland (NBP) API.
  • readsdmx: R package for reading SDMX data and metadata.
  • rsdmx: R package for reading SDMX data and metadata.
  • rwebstat: R package for accessing the Banque de France’s Webstat API.
  • siebanxicor: R package for querying data series from the Banco de México (Banxico) SIE API.
  • tidyBdE: R package for accessing the Banco de España’s API.
  • valet: R client to the Bank of Canada Valet API.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("bbk")

0.13.0 by Maximilian Mücke, 2 months ago


https://m-muecke.github.io/bbk/, https://github.com/m-muecke/bbk


Report a bug at https://github.com/m-muecke/bbk/issues


Browse source code at https://github.com/cran/bbk


Authors: Maximilian Mücke [aut, cre] (ORCID:


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports checkmate, curl, data.table, httr2, jsonlite, stats, tools, utils, xml2

Suggests ggplot2, knitr, scales, testthat


See at CRAN