bbk: Accessing Central Bank Data in R

One interface for 17 central banks

Maximilian Mücke

LMU Munich

useR! 2026 · Warsaw · 2026-07-07

Central bank data is everywhere

Policy rates, FX, yields, inflation — the backbone of economic research and financial modelling.

But every institution speaks its own dialect:

Institution API style Identifiers
ECB · Bundesbank · BIS · Norges Bank SDMX dotted keys
Czech NB · NBP · Riksbank · Banco de España JSON REST series codes
Bank of Canada Valet JSON series codes
Banco Central do Brasil OData / Olinda numeric codes
Banco de México token REST series tokens
Bank of Japan stat-search JSON db + series code
Bank of England custom CSV series codes
Banque de France webstat CSV dataset keys
Banco de Portugal BPstat JSON series ids
Österreichische Nationalbank custom XML hierarchy + key
Swiss National Bank custom CSV / JSON table ids

Different base URLs, auth, formats, pagination → access is painful.

bbk: one interface for all of them

17 central banks and growing, the same verbs everywhere:

ecb_data(flow, key)      # fetch a time series
ecb_metadata("dataflow") # browse the catalog
ecb_dimension(id)        # explore a series' dimensions

Every call returns the same tidy data.table — swap the ecb_ prefix for any bank below:

ecb_data("FM", "B.U2.EUR.4F.KR.DFR.LEV", last_n = 4)[, .(date, freq, title, value)]
         date   freq                                                 title value
       <Date> <char>                                                <char> <num>
1: 2025-03-12  daily Deposit facility - date of changes (raw data) - Level  2.50
2: 2025-04-23  daily Deposit facility - date of changes (raw data) - Level  2.25
3: 2025-06-11  daily Deposit facility - date of changes (raw data) - Level  2.00
4: 2026-06-17  daily Deposit facility - date of changes (raw data) - Level  2.25
BCBBdEBanxicoBdPBISBoC BoEBoJBdFCNBBBkECB NBPNoBSRbSNBOeNB+…

Go from identifier to plot in seconds

yield = bbk_data(
  flow = "BBSIS", key = "D.I.ZAR.ZI.EUR.S1311.B.A604.R10XX.R.A.A._Z._Z.A",
  start_period = "2015-01-01"
)

ggplot(yield, aes(date, value)) +
  geom_line(color = "#1b2a3a", linewidth = 0.7) +
  scale_y_continuous(labels = label_percent(scale = 1)) +
  labs(
    title = "German 10-year government bond yield",
    caption = sprintf("Source: Deutsche Bundesbank (BBSIS), %s.", format(max(yield$date), "%B %Y"))
  )
Line chart of the German 10-year government bond yield from 2015 to 2026, rising from below zero around 2020 to roughly 2.5 percent.

Don’t know the code? Search for it

Query the catalog with *_metadata(), then filter by plain-language name:

search "exchange rate" BBEX3 bbk_data() tidy data.table
flows = bbk_metadata("dataflow")
flows[name %ilike% "exchange rate", .(id, name = substr(name, 1, 33))]
       id                              name
   <char>                            <char>
1:  BBEE1          Effective Exchange Rates
2:  BBEE5 Indices of exchange rate effects 
3:  BBEX3 ECB euro reference exchange rates
bbk_data("BBEX3", "D.USD.EUR.BB.AC.000", last_n = 4)[, .(date, key, freq, value)]
         date                       key   freq  value
       <Date>                    <char> <char>  <num>
1: 2026-06-30 BBEX3.D.USD.EUR.BB.AC.000  daily 1.1394
2: 2026-07-01 BBEX3.D.USD.EUR.BB.AC.000  daily 1.1383
3: 2026-07-02 BBEX3.D.USD.EUR.BB.AC.000  daily 1.1399
4: 2026-07-03 BBEX3.D.USD.EUR.BB.AC.000  daily 1.1448

Same shape, every bank

Three central banks, three near-identical calls, one tidy data.table each:

from = "2015-01-01"
ecb = ecb_data(
  flow = "FM", key = "B.U2.EUR.4F.KR.DFR.LEV",
  start_period = from
)
boe = boe_data("IUDBEDR", start_date = from)
srb = srb_data("SECBREPOEFF", start_date = from)

# each *_data() is a tidy data.table -> stack them
rates = rbindlist(
  list(ECB = ecb, BoE = boe, Riksbank = srb),
  idcol = "bank",
  fill = TRUE
)

ggplot(rates, aes(date, value, color = bank)) +
  geom_step(linewidth = 1.1) +
  scale_color_manual(values = ok) +
  scale_y_continuous(labels = label_percent(scale = 1)) +
  labs(
    title = "Central bank policy rates",
    caption = sprintf(
      "Source: ECB, Bank of England, Sveriges Riksbank, %s.",
      format(max(rates$date), "%B %Y")
    )
  )

Step chart comparing policy rates of the ECB, Bank of England and Sveriges Riksbank from 2015 to 2026: all near zero until 2022, then a sharp rise, with the Bank of England highest around 4-5 percent.

Take it home

One interface · 17 central banks · tidy output · reproducible.

install.packages("bbk")

Want another central bank? Open an issue.

QR code linking to the bbk documentation website at m-muecke.github.io/bbk

Scan for the docs