| Title: | Access 'European Central Bank' Data |
|---|---|
| Description: | Provides clean, tidy access to statistical data published by the 'European Central Bank' ('ECB') via the 'ECB Data Portal' API <https://data.ecb.europa.eu>. Covers policy interest rates, 'EURIBOR', euro exchange rates, harmonised consumer price inflation ('HICP'), euro area yield curves, the euro short-term rate ('ESTR'), monetary aggregates (M1, M2, M3), mortgage and lending rates, GDP, unemployment, and government debt-to-GDP. Each dataset has a dedicated function that abstracts away the underlying 'SDMX' key structure, so users do not need to know series codes. A generic fetcher is also provided for direct access to any of the 'ECB' 100-plus dataflows. Data is downloaded on first use and cached locally for subsequent calls. |
| Authors: | Charles Coverdale [aut, cre] |
| Maintainer: | Charles Coverdale <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.3 |
| Built: | 2026-06-03 06:41:30 UTC |
| Source: | https://github.com/charlescoverdale/readecb |
Deletes all locally cached ECB data files. The next call to any data function will re-download from the ECB Data Portal.
clear_cache()clear_cache()
Invisible NULL.
Other data access:
ecb_get(),
ecb_yield_curve(),
list_ecb_dataflows()
op <- options(readecb.cache_dir = tempdir()) clear_cache() options(op)op <- options(readecb.cache_dir = tempdir()) clear_cache() options(op)
Returns the euro short-term rate, the ECB's benchmark overnight interest rate that replaced EONIA.
ecb_estr(from = NULL, to = NULL, cache = TRUE)ecb_estr(from = NULL, to = NULL, cache = TRUE)
from |
Optional start date. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
A data frame with columns:
Date.
Numeric. Rate in percent.
Other interest rates:
ecb_euribor(),
ecb_policy_rates()
op <- options(readecb.cache_dir = tempdir()) ecb_estr(from = "2024-01") options(op)op <- options(readecb.cache_dir = tempdir()) ecb_estr(from = "2024-01") options(op)
Returns EURIBOR (Euro Interbank Offered Rate) at one or more tenors. EURIBOR is the benchmark rate at which euro area banks lend to each other, widely used as a reference rate for mortgages, loans, and derivatives.
ecb_euribor(tenor = "3M", from = NULL, to = NULL, cache = TRUE)ecb_euribor(tenor = "3M", from = NULL, to = NULL, cache = TRUE)
tenor |
One or more of |
from |
Optional start date. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
A data frame with columns:
Date.
Character. EURIBOR maturity.
Numeric. Rate in percent per annum.
Other interest rates:
ecb_estr(),
ecb_policy_rates()
op <- options(readecb.cache_dir = tempdir()) ecb_euribor("3M", from = "2022-01") ecb_euribor(c("1M", "3M", "6M", "12M"), from = "2024-01") options(op)op <- options(readecb.cache_dir = tempdir()) ecb_euribor("3M", from = "2022-01") ecb_euribor(c("1M", "3M", "6M", "12M"), from = "2024-01") options(op)
Returns ECB reference exchange rates for one or more currencies against the euro.
ecb_exchange_rate( currency = "USD", frequency = c("monthly", "daily"), from = NULL, to = NULL, cache = TRUE )ecb_exchange_rate( currency = "USD", frequency = c("monthly", "daily"), from = NULL, to = NULL, cache = TRUE )
currency |
Character vector of ISO 4217 currency codes (e.g. |
frequency |
One of |
from |
Optional start date. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
A data frame with columns:
Date.
Character. ISO currency code.
Numeric. Units of foreign currency per euro.
Other exchange rates:
list_exchange_rates()
op <- options(readecb.cache_dir = tempdir()) ecb_exchange_rate("USD", from = "2024-01") ecb_exchange_rate(c("USD", "GBP", "JPY"), from = "2024-01") options(op)op <- options(readecb.cache_dir = tempdir()) ecb_exchange_rate("USD", from = "2024-01") ecb_exchange_rate(c("USD", "GBP", "JPY"), from = "2024-01") options(op)
Returns quarterly real GDP for the euro area from the ECB's national accounts dataset (MNA).
ecb_gdp(from = NULL, to = NULL, cache = TRUE)ecb_gdp(from = NULL, to = NULL, cache = TRUE)
from |
Optional start date. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
A data frame with columns:
Date. First day of the quarter.
Numeric. GDP in millions of euros (chain-linked volumes).
Other macro:
ecb_government_debt(),
ecb_unemployment()
op <- options(readecb.cache_dir = tempdir()) ecb_gdp(from = "2020") options(op)op <- options(readecb.cache_dir = tempdir()) ecb_gdp(from = "2020") options(op)
A generic fetcher for direct access to any of the ECB's dataflows. Use
list_ecb_dataflows() to discover available dataflows.
ecb_get(dataflow, key, from = NULL, to = NULL, cache = TRUE)ecb_get(dataflow, key, from = NULL, to = NULL, cache = TRUE)
dataflow |
Character. The dataflow identifier (e.g. |
key |
Character. The SDMX dimension key (e.g.
|
from |
Optional start date. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
A data frame. Columns vary by dataflow but always include
TIME_PERIOD and OBS_VALUE.
Other data access:
clear_cache(),
ecb_yield_curve(),
list_ecb_dataflows()
op <- options(readecb.cache_dir = tempdir()) # Fetch EUR/USD monthly exchange rate ecb_get("EXR", "M.USD.EUR.SP00.A", from = "2024-01") options(op)op <- options(readecb.cache_dir = tempdir()) # Fetch EUR/USD monthly exchange rate ecb_get("EXR", "M.USD.EUR.SP00.A", from = "2024-01") options(op)
Returns the annual general government consolidated gross debt as a percentage of GDP for the euro area, from the ECB's government finance statistics dataset (GFS).
ecb_government_debt(from = NULL, to = NULL, cache = TRUE)ecb_government_debt(from = NULL, to = NULL, cache = TRUE)
from |
Optional start date (year, e.g. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
A data frame with columns:
Date. 1 January of each year.
Numeric. Government debt as a percentage of GDP.
Other macro:
ecb_gdp(),
ecb_unemployment()
op <- options(readecb.cache_dir = tempdir()) ecb_government_debt(from = "2000") options(op)op <- options(readecb.cache_dir = tempdir()) ecb_government_debt(from = "2000") options(op)
Returns HICP inflation data for one or more euro area countries or country
groups. The default is the euro area aggregate ("U2").
ecb_hicp( country = "U2", measure = c("annual_rate", "index", "monthly_rate"), from = NULL, to = NULL, cache = TRUE )ecb_hicp( country = "U2", measure = c("annual_rate", "index", "monthly_rate"), from = NULL, to = NULL, cache = TRUE )
country |
Character vector of country codes. Use |
measure |
One of:
|
from |
Optional start date. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
A data frame with columns:
Date.
Character. Country or area code.
Numeric. Inflation rate or index level.
op <- options(readecb.cache_dir = tempdir()) ecb_hicp(from = "2020-01") ecb_hicp(c("DE", "FR", "IT"), from = "2023-01") options(op)op <- options(readecb.cache_dir = tempdir()) ecb_hicp(from = "2020-01") ecb_hicp(c("DE", "FR", "IT"), from = "2023-01") options(op)
Returns the composite cost-of-borrowing indicator for loans to non-financial corporations in the euro area or a specific country.
ecb_lending_rates(country = "U2", from = NULL, to = NULL, cache = TRUE)ecb_lending_rates(country = "U2", from = NULL, to = NULL, cache = TRUE)
country |
Character. Country code: |
from |
Optional start date. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
A data frame with columns:
Date.
Character. Country or area code.
Numeric. Interest rate in percent per annum.
Other credit:
ecb_money_supply(),
ecb_mortgage_rates()
op <- options(readecb.cache_dir = tempdir()) ecb_lending_rates(from = "2015-01") options(op)op <- options(readecb.cache_dir = tempdir()) ecb_lending_rates(from = "2015-01") options(op)
Returns outstanding amounts for M1, M2, or M3 monetary aggregates in the euro area.
ecb_money_supply( aggregate = c("M3", "M2", "M1"), from = NULL, to = NULL, cache = TRUE )ecb_money_supply( aggregate = c("M3", "M2", "M1"), from = NULL, to = NULL, cache = TRUE )
aggregate |
One of |
from |
Optional start date. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
A data frame with columns:
Date.
Numeric. Outstanding amount in millions of euros.
Other credit:
ecb_lending_rates(),
ecb_mortgage_rates()
op <- options(readecb.cache_dir = tempdir()) ecb_money_supply("M3", from = "2020-01") options(op)op <- options(readecb.cache_dir = tempdir()) ecb_money_supply("M3", from = "2020-01") options(op)
Returns the composite cost-of-borrowing indicator for house purchase loans in the euro area or a specific country.
ecb_mortgage_rates(country = "U2", from = NULL, to = NULL, cache = TRUE)ecb_mortgage_rates(country = "U2", from = NULL, to = NULL, cache = TRUE)
country |
Character. Country code: |
from |
Optional start date. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
A data frame with columns:
Date.
Character. Country or area code.
Numeric. Interest rate in percent per annum.
Other credit:
ecb_lending_rates(),
ecb_money_supply()
op <- options(readecb.cache_dir = tempdir()) ecb_mortgage_rates(from = "2015-01") options(op)op <- options(readecb.cache_dir = tempdir()) ecb_mortgage_rates(from = "2015-01") options(op)
Returns the three main ECB policy rates: the main refinancing operations rate, the deposit facility rate, and the marginal lending facility rate.
ecb_policy_rates(from = NULL, to = NULL, cache = TRUE)ecb_policy_rates(from = NULL, to = NULL, cache = TRUE)
from |
Optional start date (e.g. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
A data frame with columns:
Date.
Character. One of "Main refinancing rate",
"Deposit facility rate", or "Marginal lending rate".
Numeric. Rate in percent per annum.
Other interest rates:
ecb_estr(),
ecb_euribor()
op <- options(readecb.cache_dir = tempdir()) ecb_policy_rates(from = "2022-01") options(op)op <- options(readecb.cache_dir = tempdir()) ecb_policy_rates(from = "2022-01") options(op)
Returns the monthly harmonised unemployment rate for the euro area from the ECB's labour force statistics dataset (LFSI).
ecb_unemployment(from = NULL, to = NULL, cache = TRUE)ecb_unemployment(from = NULL, to = NULL, cache = TRUE)
from |
Optional start date. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
A data frame with columns:
Date.
Numeric. Unemployment rate as a percentage.
Other macro:
ecb_gdp(),
ecb_government_debt()
op <- options(readecb.cache_dir = tempdir()) ecb_unemployment(from = "2020-01") options(op)op <- options(readecb.cache_dir = tempdir()) ecb_unemployment(from = "2020-01") options(op)
Returns AAA-rated euro area government bond yields for one or more tenors.
ecb_yield_curve(tenor = "10Y", from = NULL, to = NULL, cache = TRUE)ecb_yield_curve(tenor = "10Y", from = NULL, to = NULL, cache = TRUE)
tenor |
Character vector of tenors. Common values: |
from |
Optional start date. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
A data frame with columns:
Date.
Character. Bond maturity.
Numeric. Yield in percent per annum.
Other data access:
clear_cache(),
ecb_get(),
list_ecb_dataflows()
op <- options(readecb.cache_dir = tempdir()) ecb_yield_curve("10Y", from = "2023-01") ecb_yield_curve(c("2Y", "10Y"), from = "2022-01") options(op)op <- options(readecb.cache_dir = tempdir()) ecb_yield_curve("10Y", from = "2023-01") ecb_yield_curve(c("2Y", "10Y"), from = "2022-01") options(op)
Fetches the full list of dataflows from the ECB Data Portal. Each dataflow
corresponds to a dataset that can be queried with ecb_get().
list_ecb_dataflows(cache = TRUE)list_ecb_dataflows(cache = TRUE)
cache |
Logical. Use cached data if available (default |
A data frame with columns:
Character. The dataflow identifier.
Character. Human-readable name.
Other data access:
clear_cache(),
ecb_get(),
ecb_yield_curve()
op <- options(readecb.cache_dir = tempdir()) list_ecb_dataflows() options(op)op <- options(readecb.cache_dir = tempdir()) list_ecb_dataflows() options(op)
Returns a data frame of ISO 4217 currency codes for which the ECB publishes reference exchange rates. No network call is made.
list_exchange_rates()list_exchange_rates()
A data frame with columns:
Character. ISO 4217 currency code.
Character. Currency name.
Other exchange rates:
ecb_exchange_rate()
list_exchange_rates()list_exchange_rates()