| Title: | Access 'European Central Bank' Data |
| Version: | 0.1.2 |
| 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. |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| Language: | en-GB |
| URL: | https://github.com/charlescoverdale/readecb |
| BugReports: | https://github.com/charlescoverdale/readecb/issues |
| RoxygenNote: | 7.3.3 |
| Depends: | R (≥ 4.1.0) |
| Imports: | cli (≥ 3.6.0), httr2 (≥ 1.0.0), tools |
| Suggests: | testthat (≥ 3.0.0) |
| Config/testthat/edition: | 3 |
| NeedsCompilation: | no |
| Packaged: | 2026-03-16 18:12:12 UTC; charlescoverdale |
| Author: | Charles Coverdale [aut, cre] |
| Maintainer: | Charles Coverdale <charlesfcoverdale@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-03-19 15:10:02 UTC |
readecb: 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.
Author(s)
Maintainer: Charles Coverdale charlesfcoverdale@gmail.com
See Also
Useful links:
Report bugs at https://github.com/charlescoverdale/readecb/issues
Clear the readecb cache
Description
Deletes all locally cached ECB data files. The next call to any data function will re-download from the ECB Data Portal.
Usage
clear_cache()
Value
Invisible NULL.
See Also
Other data access:
ecb_get(),
ecb_yield_curve(),
list_ecb_dataflows()
Examples
op <- options(readecb.cache_dir = tempdir())
clear_cache()
options(op)
Euro short-term rate (ESTR)
Description
Returns the euro short-term rate, the ECB's benchmark overnight interest rate that replaced EONIA.
Usage
ecb_estr(from = NULL, to = NULL, cache = TRUE)
Arguments
from |
Optional start date. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
Value
A data frame with columns:
- date
Date.
- value
Numeric. Rate in percent.
See Also
Other interest rates:
ecb_euribor(),
ecb_policy_rates()
Examples
op <- options(readecb.cache_dir = tempdir())
ecb_estr(from = "2024-01")
options(op)
EURIBOR interbank lending rates
Description
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.
Usage
ecb_euribor(tenor = "3M", from = NULL, to = NULL, cache = TRUE)
Arguments
tenor |
One or more of |
from |
Optional start date. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
Value
A data frame with columns:
- date
Date.
- tenor
Character. EURIBOR maturity.
- value
Numeric. Rate in percent per annum.
See Also
Other interest rates:
ecb_estr(),
ecb_policy_rates()
Examples
op <- options(readecb.cache_dir = tempdir())
ecb_euribor("3M", from = "2022-01")
ecb_euribor(c("1M", "3M", "6M", "12M"), from = "2024-01")
options(op)
Euro exchange rates
Description
Returns ECB reference exchange rates for one or more currencies against the euro.
Usage
ecb_exchange_rate(
currency = "USD",
frequency = c("monthly", "daily"),
from = NULL,
to = NULL,
cache = TRUE
)
Arguments
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 |
Value
A data frame with columns:
- date
Date.
- currency
Character. ISO currency code.
- value
Numeric. Units of foreign currency per euro.
See Also
Other exchange rates:
list_exchange_rates()
Examples
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)
Euro area GDP
Description
Returns quarterly real GDP for the euro area from the ECB's national accounts dataset (MNA).
Usage
ecb_gdp(from = NULL, to = NULL, cache = TRUE)
Arguments
from |
Optional start date. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
Value
A data frame with columns:
- date
Date. First day of the quarter.
- value
Numeric. GDP in millions of euros (chain-linked volumes).
See Also
Other macro:
ecb_government_debt(),
ecb_unemployment()
Examples
op <- options(readecb.cache_dir = tempdir())
ecb_gdp(from = "2020")
options(op)
Fetch any ECB dataflow
Description
A generic fetcher for direct access to any of the ECB's dataflows. Use
list_ecb_dataflows() to discover available dataflows.
Usage
ecb_get(dataflow, key, from = NULL, to = NULL, cache = TRUE)
Arguments
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 |
Value
A data frame. Columns vary by dataflow but always include
TIME_PERIOD and OBS_VALUE.
See Also
Other data access:
clear_cache(),
ecb_yield_curve(),
list_ecb_dataflows()
Examples
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)
Euro area government debt-to-GDP ratio
Description
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).
Usage
ecb_government_debt(from = NULL, to = NULL, cache = TRUE)
Arguments
from |
Optional start date (year, e.g. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
Value
A data frame with columns:
- date
Date. 1 January of each year.
- value
Numeric. Government debt as a percentage of GDP.
See Also
Other macro:
ecb_gdp(),
ecb_unemployment()
Examples
op <- options(readecb.cache_dir = tempdir())
ecb_government_debt(from = "2000")
options(op)
Harmonised Index of Consumer Prices (HICP)
Description
Returns HICP inflation data for one or more euro area countries or country
groups. The default is the euro area aggregate ("U2").
Usage
ecb_hicp(
country = "U2",
measure = c("annual_rate", "index", "monthly_rate"),
from = NULL,
to = NULL,
cache = TRUE
)
Arguments
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 |
Value
A data frame with columns:
- date
Date.
- country
Character. Country or area code.
- value
Numeric. Inflation rate or index level.
Examples
op <- options(readecb.cache_dir = tempdir())
ecb_hicp(from = "2020-01")
ecb_hicp(c("DE", "FR", "IT"), from = "2023-01")
options(op)
Lending interest rates to non-financial corporations
Description
Returns the composite cost-of-borrowing indicator for loans to non-financial corporations in the euro area or a specific country.
Usage
ecb_lending_rates(country = "U2", from = NULL, to = NULL, cache = TRUE)
Arguments
country |
Character. Country code: |
from |
Optional start date. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
Value
A data frame with columns:
- date
Date.
- country
Character. Country or area code.
- value
Numeric. Interest rate in percent per annum.
See Also
Other credit:
ecb_money_supply(),
ecb_mortgage_rates()
Examples
op <- options(readecb.cache_dir = tempdir())
ecb_lending_rates(from = "2015-01")
options(op)
Euro area monetary aggregates
Description
Returns outstanding amounts for M1, M2, or M3 monetary aggregates in the euro area.
Usage
ecb_money_supply(
aggregate = c("M3", "M2", "M1"),
from = NULL,
to = NULL,
cache = TRUE
)
Arguments
aggregate |
One of |
from |
Optional start date. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
Value
A data frame with columns:
- date
Date.
- value
Numeric. Outstanding amount in millions of euros.
See Also
Other credit:
ecb_lending_rates(),
ecb_mortgage_rates()
Examples
op <- options(readecb.cache_dir = tempdir())
ecb_money_supply("M3", from = "2020-01")
options(op)
Mortgage interest rates
Description
Returns the composite cost-of-borrowing indicator for house purchase loans in the euro area or a specific country.
Usage
ecb_mortgage_rates(country = "U2", from = NULL, to = NULL, cache = TRUE)
Arguments
country |
Character. Country code: |
from |
Optional start date. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
Value
A data frame with columns:
- date
Date.
- country
Character. Country or area code.
- value
Numeric. Interest rate in percent per annum.
See Also
Other credit:
ecb_lending_rates(),
ecb_money_supply()
Examples
op <- options(readecb.cache_dir = tempdir())
ecb_mortgage_rates(from = "2015-01")
options(op)
ECB policy interest rates
Description
Returns the three main ECB policy rates: the main refinancing operations rate, the deposit facility rate, and the marginal lending facility rate.
Usage
ecb_policy_rates(from = NULL, to = NULL, cache = TRUE)
Arguments
from |
Optional start date (e.g. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
Value
A data frame with columns:
- date
Date.
- rate
Character. One of
"Main refinancing rate","Deposit facility rate", or"Marginal lending rate".- value
Numeric. Rate in percent per annum.
See Also
Other interest rates:
ecb_estr(),
ecb_euribor()
Examples
op <- options(readecb.cache_dir = tempdir())
ecb_policy_rates(from = "2022-01")
options(op)
Euro area unemployment rate
Description
Returns the monthly harmonised unemployment rate for the euro area from the ECB's labour force statistics dataset (LFSI).
Usage
ecb_unemployment(from = NULL, to = NULL, cache = TRUE)
Arguments
from |
Optional start date. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
Value
A data frame with columns:
- date
Date.
- value
Numeric. Unemployment rate as a percentage.
See Also
Other macro:
ecb_gdp(),
ecb_government_debt()
Examples
op <- options(readecb.cache_dir = tempdir())
ecb_unemployment(from = "2020-01")
options(op)
Euro area government bond yield curve
Description
Returns AAA-rated euro area government bond yields for one or more tenors.
Usage
ecb_yield_curve(tenor = "10Y", from = NULL, to = NULL, cache = TRUE)
Arguments
tenor |
Character vector of tenors. Common values: |
from |
Optional start date. |
to |
Optional end date. |
cache |
Logical. Use cached data if available (default |
Value
A data frame with columns:
- date
Date.
- tenor
Character. Bond maturity.
- value
Numeric. Yield in percent per annum.
See Also
Other data access:
clear_cache(),
ecb_get(),
list_ecb_dataflows()
Examples
op <- options(readecb.cache_dir = tempdir())
ecb_yield_curve("10Y", from = "2023-01")
ecb_yield_curve(c("2Y", "10Y"), from = "2022-01")
options(op)
List available ECB dataflows
Description
Fetches the full list of dataflows from the ECB Data Portal. Each dataflow
corresponds to a dataset that can be queried with ecb_get().
Usage
list_ecb_dataflows(cache = TRUE)
Arguments
cache |
Logical. Use cached data if available (default |
Value
A data frame with columns:
- dataflow_id
Character. The dataflow identifier.
- name
Character. Human-readable name.
See Also
Other data access:
clear_cache(),
ecb_get(),
ecb_yield_curve()
Examples
op <- options(readecb.cache_dir = tempdir())
list_ecb_dataflows()
options(op)
List available exchange rate currencies
Description
Returns a data frame of ISO 4217 currency codes for which the ECB publishes reference exchange rates. No network call is made.
Usage
list_exchange_rates()
Value
A data frame with columns:
- code
Character. ISO 4217 currency code.
- currency
Character. Currency name.
See Also
Other exchange rates:
ecb_exchange_rate()
Examples
list_exchange_rates()