Package {ecb}


Type: Package
Title: Programmatic Access to the European Central Bank's Data Portal
Version: 0.4.4
Date: 2026-11-05
Description: Provides an interface to the European Central Bank's Data Portal API, allowing for programmatic retrieval of a vast quantity of statistical data.
License: CC0
URL: https://github.com/expersso/ecb
BugReports: https://github.com/expersso/ecb/issues
Suggests: knitr, rmarkdown, dplyr, lubridate, ggplot2, testthat, zoo
Imports: curl, rsdmx, xml2, httr
VignetteBuilder: knitr
RoxygenNote: 7.3.2
Encoding: UTF-8
NeedsCompilation: no
Packaged: 2026-11-09 12:42:35 UTC; ericpersson
Author: Eric Persson [aut, cre], Franz X. Mohr ORCID iD [ctb]
Maintainer: Eric Persson <expersso5@gmail.com>
Repository: CRAN
Date/Publication: 2026-11-09 14:00:02 UTC

Format date variable retrieved from the SDW into a proper date variable

Description

Format date variable retrieved from the SDW into a proper date variable

Usage

convert_dates(x)

Arguments

x

A vector of dates

Value

A date-formatted vector

Examples

convert_dates(c("2024-01", "2024-02", "2024-03"))
convert_dates(c("2023-Q4", "2024-Q1"))


hicp <- get_data("ICP.M.U2.N.000000.4.ANR")
if (!is.null(hicp)) {
  hicp$obstime <- convert_dates(hicp$obstime)
  str(hicp)
}


Retrieve data from the ECB Statistical Data Warehouse API

Description

Retrieve data from the ECB Statistical Data Warehouse API

Usage

get_data(key, filter = NULL, ...)

Arguments

key

A character string identifying the series to be retrieved

filter

A named list with additional filters (see details)

...

Arguments passed to GET (e.g. timeout(10) to add maximum request time)

Details

The filter option of get_data() takes a named list of key-value pairs. If left blank, it returns all data for the current version.

Available filter parameters:

See the ECB Data Portal API documentation for more details.

Value

A data frame, or NULL (with an informative message) if the ECB Data Portal cannot be reached or returns an unexpected response.

Examples


# Get monthly data on annualized euro area headline HICP
hicp <- get_data("ICP.M.U2.N.000000.4.ANR")
head(hicp)


Retrieve data frame of all datasets in the ECB Statistical Data Warehouse

Description

Retrieve data frame of all datasets in the ECB Statistical Data Warehouse

Usage

get_dataflows(...)

Arguments

...

Arguments passed to GET (e.g. timeout(10) to add maximum request time)

Value

A dataframe, or NULL (with an informative message) if the ECB Data Portal cannot be reached or returns an unexpected response.

Examples


df <- get_dataflows()
head(df)


Get full, human-readable description of a series

Description

Get full, human-readable description of a series

Usage

get_description(key, ...)

Arguments

key

A character string identifying the series to be retrieved

...

Arguments passed to GET (e.g. timeout(10) to add maximum request time)

Value

A character vector, or NULL (with an informative message) if the ECB Data Portal cannot be reached or returns an unexpected response.

Examples


get_description("ICP.M.DE.N.000000+XEF000.4.ANR")


Retrieve dimensions of series in the ECB's SDW

Description

Retrieve dimensions of series in the ECB's SDW

Usage

get_dimensions(key, ...)

Arguments

key

A character string identifying the series to be retrieved

...

Arguments passed to GET (e.g. timeout(10) to add maximum request time)

Value

A list of data frames, one for each series retrieved, or NULL (with an informative message) if the ECB Data Portal cannot be reached or returns an unexpected response.

Examples


hicp_dims <- get_dimensions("ICP.M.U2.N.000000.4.ANR")
if (!is.null(hicp_dims)) hicp_dims[[1]]