Title: Download Data from the 'Bank of England' Statistical Database
Version: 0.2.0
Description: Provides functions to download and tidy statistical data published by the 'Bank of England' https://www.bankofengland.co.uk. Covers Bank Rate, 'SONIA', gilt yields, exchange rates, mortgage rates, mortgage approvals, consumer credit, and money supply. Series are fetched from the 'Bank of England Interactive Statistical Database' using its CSV endpoint. Data is cached locally between sessions.
License: MIT + file LICENSE
Encoding: UTF-8
Language: en-GB
RoxygenNote: 7.3.3
Imports: cli (≥ 3.6.0), httr2 (≥ 1.0.0), tools
Suggests: testthat (≥ 3.0.0), ggplot2, scales, readxl (≥ 1.4.0)
Config/testthat/edition: 3
URL: https://charlescoverdale.github.io/boe/, https://github.com/charlescoverdale/boe
BugReports: https://github.com/charlescoverdale/boe/issues
Depends: R (≥ 4.1.0)
LazyData: true
NeedsCompilation: no
Packaged: 2026-04-27 18:51:42 UTC; charlescoverdale
Author: Charles Coverdale [aut, cre]
Maintainer: Charles Coverdale <charlesfcoverdale@gmail.com>
Repository: CRAN
Date/Publication: 2026-04-27 19:20:02 UTC

boe: Download Data from the 'Bank of England' Statistical Database

Description

Provides functions to download and tidy statistical data published by the 'Bank of England' https://www.bankofengland.co.uk. Covers Bank Rate, 'SONIA', gilt yields, exchange rates, mortgage rates, mortgage approvals, consumer credit, and money supply. Series are fetched from the 'Bank of England Interactive Statistical Database' using its CSV endpoint. Data is cached locally between sessions.

Author(s)

Maintainer: Charles Coverdale charlesfcoverdale@gmail.com

See Also

Useful links:


Download Bank of England Bank Rate history

Description

Downloads the official Bank Rate (base interest rate) set by the Monetary Policy Committee. Available as a daily series from January 1975.

Usage

boe_bank_rate(
  from = "1975-01-02",
  to = Sys.Date(),
  frequency = c("daily", "monthly"),
  cache = TRUE
)

Arguments

from

Date or character (YYYY-MM-DD). Start date. Defaults to "1975-01-02".

to

Date or character (YYYY-MM-DD). End date. Defaults to today.

frequency

Character. One of "daily" (default) or "monthly" (monthly average).

cache

Logical. Use cached data if available (default TRUE).

Value

A data frame with columns:

date

Date. Observation date.

rate_pct

Numeric. Bank Rate (percent).

Source

https://www.bankofengland.co.uk/boeapps/database/

See Also

Other interest rates: boe_curve(), boe_sonia(), boe_yield_curve()

Examples


op <- options(boe.cache_dir = tempdir())
# Bank Rate since 2000
boe_bank_rate(from = "2000-01-01")

# Monthly average
boe_bank_rate(from = "2020-01-01", frequency = "monthly")
options(op)



Browse the BoE series catalogue

Description

Returns the catalogue with optional category or frequency filters. Equivalent to boe_search(query = NULL, category, frequency) but framed as a browse / inspect action rather than a keyword search.

Usage

boe_browse(category = NULL, frequency = NULL)

Arguments

category

Character. Optional filter on the category column, one or more of "interest_rates", "exchange_rates", "mortgage_market", "consumer_credit", "monetary_aggregates".

frequency

Character. Optional filter on the frequency column, one or more of "daily", "monthly", "annual".

Value

A data frame with the same columns as boe_series.

See Also

boe_search(), boe_series

Other discovery: boe_search()

Examples

# The whole catalogue
nrow(boe_browse())

# All exchange rate series
boe_browse(category = "exchange_rates")

# All monthly series
boe_browse(frequency = "monthly")


Inspect the local BoE cache

Description

Reports the cache directory, number of cached files, total size, and oldest / newest modification timestamps. Prints a short summary and returns the underlying values invisibly.

Usage

boe_cache_info()

Details

The cache directory defaults to tools::R_user_dir("boe", "cache") and can be overridden with options(boe.cache_dir = ...).

Value

Invisibly, a list with elements:

path

Character. Cache directory.

n_files

Integer. Number of cached files.

total_size_bytes

Numeric. Total size on disk (bytes).

oldest

POSIXct. Modification time of oldest file (or NA if cache is empty).

newest

POSIXct. Modification time of newest file (or NA if cache is empty).

See Also

clear_cache()

Examples


op <- options(boe.cache_dir = tempdir())
boe_cache_info()
options(op)



Download consumer credit outstanding

Description

Downloads monthly outstanding amounts of consumer credit (total, credit cards, and other consumer credit). Seasonally adjusted. Available from April 1993.

Usage

boe_consumer_credit(
  type = c("total", "credit_card", "other"),
  from = "1993-04-01",
  to = Sys.Date(),
  cache = TRUE
)

Arguments

type

Character vector. One or more of "total", "credit_card", "other". Defaults to all three.

from

Date or character (YYYY-MM-DD). Start date. Defaults to "1993-04-01".

to

Date or character (YYYY-MM-DD). End date. Defaults to today.

cache

Logical. Use cached data if available (default TRUE).

Value

A data frame with columns:

date

Date. End of month.

type

Character. Credit type.

amount_gbp_m

Numeric. Outstanding amount (millions of pounds).

Source

https://www.bankofengland.co.uk/boeapps/database/

See Also

Other credit and housing: boe_mortgage_approvals(), boe_mortgage_rates()

Examples


op <- options(boe.cache_dir = tempdir())
boe_consumer_credit(from = "2015-01-01")
options(op)



Download the BoE Anderson-Sleath fitted yield curves

Description

Downloads the Bank of England's published fitted yield curves at all maturities (typically 0.5 to 25 or 40 years) using the Anderson and Sleath (2001) smoothing methodology. Returns the latest month's daily data covering the four published curves: nominal gilt, real (index-linked) gilt, implied inflation, and overnight index swap (OIS).

Usage

boe_curve(
  curve = c("nominal", "real", "inflation", "ois"),
  measure = c("spot", "forward"),
  cache = TRUE
)

Arguments

curve

Character. Which curve to fetch. One of "nominal", "real", "inflation", or "ois". Defaults to "nominal".

measure

Character. "spot" (default) or "forward".

cache

Logical. Use cached download if available and less than 24 hours old (default TRUE).

Details

Coverage is limited to the latest published month. Historical archive loading is planned for a subsequent release.

Requires the readxl package. The data is published as an Excel workbook inside a zip archive at https://www.bankofengland.co.uk/statistics/yield-curves.

Value

A boe_tbl data frame with columns:

date

Date. Observation date.

maturity_years

Numeric. Maturity in years.

rate_pct

Numeric. Yield or implied rate (percent).

Source

https://www.bankofengland.co.uk/statistics/yield-curves

References

Anderson, N. and Sleath, J. (2001). New estimates of the UK real and nominal yield curves. Bank of England Working Paper No. 126. https://www.bankofengland.co.uk/working-paper/2001/new-estimates-of-the-uk-real-and-nominal-yield-curves

See Also

Other interest rates: boe_bank_rate(), boe_sonia(), boe_yield_curve()

Examples


if (requireNamespace("readxl", quietly = TRUE)) {
  op <- options(boe.cache_dir = tempdir())
  # Latest nominal spot curve at all maturities
  curve <- boe_curve(curve = "nominal", measure = "spot")
  head(curve)
  options(op)
}



Download sterling exchange rates

Description

Downloads daily spot exchange rates for sterling against major currencies from the Bank of England. Most series available from January 1975.

Usage

boe_exchange_rate(
  currency = "USD",
  from = "1975-01-02",
  to = Sys.Date(),
  cache = TRUE
)

Arguments

currency

Character vector. One or more currency codes. Use list_exchange_rates() to see all available currencies. Defaults to "USD".

from

Date or character (YYYY-MM-DD). Start date. Defaults to "1975-01-02".

to

Date or character (YYYY-MM-DD). End date. Defaults to today.

cache

Logical. Use cached data if available (default TRUE).

Value

A data frame with columns:

date

Date. Observation date.

currency

Character. Currency code (e.g. "USD").

rate

Numeric. Units of foreign currency per GBP.

Source

https://www.bankofengland.co.uk/boeapps/database/

See Also

Other exchange rates: list_exchange_rates()

Examples


op <- options(boe.cache_dir = tempdir())
# GBP/USD since 2020
boe_exchange_rate("USD", from = "2020-01-01")

# Multiple currencies
boe_exchange_rate(c("USD", "EUR", "JPY"), from = "2020-01-01")
options(op)



Fetch any series from the Bank of England Statistical Database

Description

The core data retrieval function. Fetches one or more series by their BoE series codes and returns a tidy data frame. Use this when the convenience functions (e.g. boe_bank_rate(), boe_exchange_rate()) do not cover the series you need.

Usage

boe_get(series_codes, from = "1960-01-01", to = Sys.Date(), cache = TRUE)

Arguments

series_codes

Character vector of one or more BoE series codes.

from

Date or character (YYYY-MM-DD). Start date. Defaults to "1960-01-01".

to

Date or character (YYYY-MM-DD). End date. Defaults to today.

cache

Logical. Use cached data if available (default TRUE).

Details

Series codes can be found via the Bank of England Interactive Statistical Database at https://www.bankofengland.co.uk/boeapps/database/.

Value

A data frame with columns:

date

Date. Observation date.

code

Character. BoE series code.

value

Numeric. Observation value.

Source

https://www.bankofengland.co.uk/boeapps/database/

See Also

Other data access: clear_cache()

Examples


op <- options(boe.cache_dir = tempdir())
# Bank Rate since 2000
boe_get("IUDBEDR", from = "2000-01-01")

# Multiple series
boe_get(c("IUDBEDR", "IUDSOIA"), from = "2020-01-01")
options(op)



Download M4 money supply

Description

Downloads monthly M4 (broad money) amounts outstanding from the Bank of England. Available from June 1982.

Usage

boe_money_supply(
  from = "1982-06-01",
  to = Sys.Date(),
  seasonally_adjusted = TRUE,
  cache = TRUE
)

Arguments

from

Date or character (YYYY-MM-DD). Start date. Defaults to "1982-06-01".

to

Date or character (YYYY-MM-DD). End date. Defaults to today.

seasonally_adjusted

Logical. Return seasonally adjusted series (default TRUE) or non-seasonally adjusted (FALSE).

cache

Logical. Use cached data if available (default TRUE).

Value

A data frame with columns:

date

Date. End of month.

amount_gbp_m

Numeric. M4 amounts outstanding (millions of pounds).

Source

https://www.bankofengland.co.uk/boeapps/database/

Examples


op <- options(boe.cache_dir = tempdir())
boe_money_supply(from = "2000-01-01")
options(op)



Download mortgage approvals for house purchase

Description

Downloads the monthly count of mortgage approvals for house purchase, a widely watched leading indicator of housing market activity. Available from April 1993.

Usage

boe_mortgage_approvals(
  from = "1993-04-01",
  to = Sys.Date(),
  seasonally_adjusted = TRUE,
  cache = TRUE
)

Arguments

from

Date or character (YYYY-MM-DD). Start date. Defaults to "1993-04-01".

to

Date or character (YYYY-MM-DD). End date. Defaults to today.

seasonally_adjusted

Logical. Return seasonally adjusted series (default TRUE) or non-seasonally adjusted (FALSE).

cache

Logical. Use cached data if available (default TRUE).

Value

A data frame with columns:

date

Date. End of month.

approvals

Numeric. Number of mortgage approvals.

Source

https://www.bankofengland.co.uk/boeapps/database/

See Also

Other credit and housing: boe_consumer_credit(), boe_mortgage_rates()

Examples


op <- options(boe.cache_dir = tempdir())
boe_mortgage_approvals(from = "2015-01-01")
options(op)



Download quoted mortgage interest rates

Description

Downloads monthly quoted (advertised) mortgage rates from the Bank of England, including fixed-rate products and the standard variable rate (SVR). Available from January 1995.

Usage

boe_mortgage_rates(
  type = c("2yr_fixed", "3yr_fixed", "5yr_fixed", "svr"),
  from = "1995-01-01",
  to = Sys.Date(),
  cache = TRUE
)

Arguments

type

Character vector. One or more of "2yr_fixed", "3yr_fixed", "5yr_fixed", "svr". Defaults to all four.

from

Date or character (YYYY-MM-DD). Start date. Defaults to "1995-01-01".

to

Date or character (YYYY-MM-DD). End date. Defaults to today.

cache

Logical. Use cached data if available (default TRUE).

Value

A data frame with columns:

date

Date. End of month.

type

Character. Mortgage product type.

rate_pct

Numeric. Quoted rate (percent).

Source

https://www.bankofengland.co.uk/boeapps/database/

See Also

Other credit and housing: boe_consumer_credit(), boe_mortgage_approvals()

Examples


op <- options(boe.cache_dir = tempdir())
# All mortgage rate types since 2015
boe_mortgage_rates(from = "2015-01-01")

# 2-year fixed only
boe_mortgage_rates(type = "2yr_fixed", from = "2020-01-01")
options(op)



Bank Rate decision history

Description

Returns the history of Monetary Policy Committee decisions to change Bank Rate, derived from the daily Bank Rate series. Each row is one rate-change event, showing the effective date, the new rate, the previous rate, and the change in basis points. Holds (meetings where the rate was unchanged) are not included; for the full meeting-level record including holds, see boe_mpc_votes().

Usage

boe_mpc_decisions(from = "1997-06-06", to = Sys.Date(), cache = TRUE)

Arguments

from

Date or character. Start date. Defaults to "1997-06-06" (the first MPC meeting).

to

Date or character. End date. Defaults to today.

cache

Logical. Use cached Bank Rate data if available (default TRUE).

Value

A boe_tbl data frame with columns:

date

Date. Effective date of the rate change.

new_rate_pct

Numeric. Bank Rate after the decision (percent).

prev_rate_pct

Numeric. Bank Rate before the decision (percent).

change_bps

Integer. Change in basis points (positive = hike, negative = cut).

direction

Character. "hike" or "cut".

Source

Derived from BoE series IUDBEDR (daily Bank Rate). See https://www.bankofengland.co.uk/monetary-policy.

See Also

boe_bank_rate(), boe_mpc_votes()

Other monetary policy: boe_mpc_votes(), boe_mpr_forecasts()

Examples


op <- options(boe.cache_dir = tempdir())
# All MPC decisions since the global financial crisis
boe_mpc_decisions(from = "2007-01-01")

# Just decisions in 2024 to date
boe_mpc_decisions(from = "2024-01-01")
options(op)



Monetary Policy Committee voting history

Description

Downloads the Bank of England's published MPC voting record and returns it in long format. Each row is one (meeting, member) pair showing the rate the member voted for and whether that constituted a dissent from the committee's decision.

Usage

boe_mpc_votes(cache = TRUE)

Arguments

cache

Logical. Use cached download if less than 24 hours old (default TRUE). The voting workbook is small (~110 KB).

Details

Coverage runs from the first MPC meeting in June 1997 through the most recent published minutes. Both current and past committee members are included.

Requires the readxl package.

Value

A boe_tbl data frame with columns:

date

Date. Meeting date.

member

Character. MPC member name.

member_vote_pct

Numeric. The Bank Rate the member voted for (percent).

decision_pct

Numeric. The committee's decision (percent).

dissent

Logical. TRUE if the member's vote differed from the committee decision.

Source

https://www.bankofengland.co.uk/monetary-policy

See Also

boe_mpc_decisions()

Other monetary policy: boe_mpc_decisions(), boe_mpr_forecasts()

Examples


if (requireNamespace("readxl", quietly = TRUE)) {
  op <- options(boe.cache_dir = tempdir())
  votes <- boe_mpc_votes()

  # Recent dissents
  recent <- subset(votes, dissent & date >= as.Date("2024-01-01"))
  head(recent)

  options(op)
}



Monetary Policy Report forecast data

Description

Downloads the Bank of England's Monetary Policy Report (MPR) and parses headline projections from the Projections Databank workbook. Returns a long-format data frame where each row is one (publication date, forecast horizon, series) triple.

Usage

boe_mpr_forecasts(
  series = c("cpi_inflation", "gdp_growth", "gdp_level", "unemployment", "bank_rate"),
  month = NULL,
  year = NULL,
  cache = TRUE
)

Arguments

series

Character vector. One or more of: "cpi_inflation", "gdp_growth", "gdp_level", "unemployment", "bank_rate". Defaults to all five.

month

Character. "february", "may", "august", or "november". If NULL, the most recent quarterly release is used.

year

Integer. MPR year, 2019 or later. If NULL, the most recent quarterly release is used.

cache

Logical. Use cached download if available (default TRUE). Older releases never change so the cache never expires; the latest release is refreshed if older than 24 hours.

Details

Coverage runs quarterly from November 2019 (when the report was renamed from Inflation Report) to the latest published release.

Requires the readxl package. The MPR is published as a zip archive containing a Projections Databank workbook plus chart data and slides; this function only reads the projection sheets.

Each row of a projection sheet is one MPR publication; columns are forecast quarters. The same publication therefore contributes multiple rows here, one per forecast horizon.

Value

A boe_tbl data frame with columns:

date

Date. Publication date of the MPR (start of quarter the report covers).

horizon

Character. Forecast horizon label (e.g. "2026 Q1").

horizon_date

Date. Start of the forecast quarter.

series

Character. Series identifier (e.g. "cpi_inflation").

value

Numeric. Forecast value (percent for rates and growth; index for gdp_level).

Older releases

Pre-2025 MPRs are packaged differently and do not contain a single "Projections Databank" workbook. This function targets the post-2025 format and may error on older releases.

Source

https://www.bankofengland.co.uk/monetary-policy

See Also

boe_mpc_decisions(), boe_mpc_votes()

Other monetary policy: boe_mpc_decisions(), boe_mpc_votes()

Examples


if (requireNamespace("readxl", quietly = TRUE)) {
  op <- options(boe.cache_dir = tempdir())

  # Latest CPI inflation projections
  cpi <- boe_mpr_forecasts(series = "cpi_inflation")
  head(cpi)

  options(op)
}



Description

Filters the boe_series catalogue by keyword and optional category and frequency. Useful for finding a series code without leaving R. Equivalent to a grepl against the title and code columns.

Usage

boe_search(query = NULL, category = NULL, frequency = NULL)

Arguments

query

Character. Keyword(s) to match against the title and code columns. Case-insensitive substring match. If NULL, returns all rows (subject to other filters).

category

Character. Optional filter on the category column, one or more of "interest_rates", "exchange_rates", "mortgage_market", "consumer_credit", "monetary_aggregates".

frequency

Character. Optional filter on the frequency column, one or more of "daily", "monthly", "annual".

Value

A data frame with the same columns as boe_series, restricted to matching rows.

See Also

boe_browse(), boe_series

Other discovery: boe_browse()

Examples

# Find mortgage-related series
boe_search("mortgage")

# All daily interest-rate series
boe_search(category = "interest_rates", frequency = "daily")

# Locate the Bank Rate code
boe_search("bank rate")


Catalogue of BoE series wrapped by this package

Description

A reference data frame of Bank of England Statistical Database series codes for which the package provides a named convenience function. Used by boe_search() and boe_browse().

Usage

boe_series

Format

A data frame with 8 columns:

code

Character. BoE series code (e.g. "IUDBEDR").

title

Character. Human-readable description.

category

Character. Topic grouping. One of "interest_rates", "exchange_rates", "mortgage_market", "consumer_credit", "monetary_aggregates".

frequency

Character. Native publication frequency ("daily", "monthly", "annual").

unit

Character. Unit of measurement ("percent", "millions_gbp", "currency_per_gbp", "index", "count").

start_date

Date. Earliest available observation date.

seasonal_adjustment

Character or NA. "SA", "NSA", or NA if not applicable.

helper

Character. Convenience function in the package that wraps the series.

Source

https://www.bankofengland.co.uk/boeapps/database/

Examples

head(boe_series)
table(boe_series$category)

Download SONIA interest rate

Description

Downloads the Sterling Overnight Index Average (SONIA), the risk-free reference rate for sterling markets. Available daily from January 1997.

Usage

boe_sonia(
  from = "1997-01-02",
  to = Sys.Date(),
  frequency = c("daily", "monthly", "annual"),
  cache = TRUE
)

Arguments

from

Date or character (YYYY-MM-DD). Start date. Defaults to "1997-01-02".

to

Date or character (YYYY-MM-DD). End date. Defaults to today.

frequency

Character. One of "daily" (default), "monthly" (monthly average), or "annual" (annual average).

cache

Logical. Use cached data if available (default TRUE).

Value

A data frame with columns:

date

Date. Observation date.

rate_pct

Numeric. SONIA rate (percent).

Source

https://www.bankofengland.co.uk/boeapps/database/

See Also

Other interest rates: boe_bank_rate(), boe_curve(), boe_yield_curve()

Examples


op <- options(boe.cache_dir = tempdir())
boe_sonia(from = "2020-01-01")
options(op)



Download UK gilt yields

Description

Downloads nominal or real gilt yields at specified maturities from the Bank of England yield curve data. Nominal par yields are available daily from late 1993; real zero-coupon yields from 1985.

Usage

boe_yield_curve(
  from = "2000-01-01",
  to = Sys.Date(),
  maturity = c("5yr", "10yr", "20yr"),
  type = c("nominal", "real"),
  measure = c("par_yield", "zero_coupon"),
  cache = TRUE
)

Arguments

from

Date or character (YYYY-MM-DD). Start date.

to

Date or character (YYYY-MM-DD). End date. Defaults to today.

maturity

Character vector. One or more of "5yr", "10yr", "20yr". Defaults to all three.

type

Character. "nominal" (default) or "real".

measure

Character. "par_yield" (default, nominal only) or "zero_coupon".

cache

Logical. Use cached data if available (default TRUE).

Value

A data frame with columns:

date

Date. Observation date.

maturity

Character. Maturity label (e.g. "5yr").

yield_pct

Numeric. Yield (percent).

Source

https://www.bankofengland.co.uk/boeapps/database/

See Also

Other interest rates: boe_bank_rate(), boe_curve(), boe_sonia()

Examples


op <- options(boe.cache_dir = tempdir())
# 10-year nominal gilt yield since 2020
boe_yield_curve(from = "2020-01-01", maturity = "10yr")

# Full nominal curve
boe_yield_curve(from = "2020-01-01")

# Real yields
boe_yield_curve(from = "2020-01-01", type = "real", measure = "zero_coupon")
options(op)



Clear locally cached Bank of England data

Description

Removes cached data files downloaded from the Bank of England.

Usage

clear_cache(max_age_days = NULL)

Arguments

max_age_days

Numeric or NULL. If specified, only removes files older than this many days. If NULL (the default), removes all cached files.

Value

Invisibly returns the number of files removed.

See Also

Other data access: boe_get()

Examples


op <- options(boe.cache_dir = tempdir())
# Remove files older than 7 days
clear_cache(max_age_days = 7)

# Remove everything
clear_cache()
options(op)



List available exchange rate currencies

Description

Returns a data frame of currency codes and descriptions available from the Bank of England exchange rate series.

Usage

list_exchange_rates()

Value

A data frame with columns:

currency

Character. ISO currency code.

description

Character. Currency name.

boe_code

Character. BoE series code.

See Also

Other exchange rates: boe_exchange_rate()

Examples

list_exchange_rates()


Print method for boe_tbl

Description

Adds a one-line provenance header above the data frame body. The header summarises the request: number of series (and codes if few), observation count, date range, frequency, and any vintage tag.

Usage

## S3 method for class 'boe_tbl'
print(x, ...)

Arguments

x

A boe_tbl.

...

Passed to the underlying print.data.frame method.

Value

x, invisibly.

Examples


op <- options(boe.cache_dir = tempdir())
x <- boe_bank_rate(from = "2020-01-01", frequency = "monthly")
print(x)
options(op)