European Central Bank’s API
Data - ecb
Info
List of APIs
LAST_COMPILE
LAST_COMPILE |
---|
2024-10-09 |
Data Structure Definition (DSD)
Code
<- "https://sdw-wsrest.ecb.europa.eu/service/codelist/all/all/latest?detail=allstubs" %>%
new readSDMX() %>%
slot("codelists")
<- "https://sdw-wsrest.ecb.europa.eu/service/datastructure/ECB/ECB_EXR1/1.0?references=children" %>%
new2 readSDMX()
Info
Help for the SDMX protocol: https://sdw-wsrest.ecb.europa.eu/help/
Datasets from the ECB: https://www.ecb.europa.eu/stats/ecb_statistics/escb/html/index.en.html
Statistical Data Warehouse: http://sdw.ecb.europa.eu/browse.do?node=bbn2883
US Dollar / Euro Exchange Rate
Annual
Code
"https://sdw-wsrest.ecb.europa.eu/service/data/EXR/M.USD.EUR.SP00.A" %>%
readSDMX() %>%
%>%
as_tibble month_to_date() %>%
ggplot(.) + geom_line(aes(x = date, y = obsValue)) +
theme_minimal() + xlab("") + ylab("") +
scale_x_date(breaks = seq(1960, 2026, 2) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%Y")) +
scale_y_continuous(breaks = seq(0, 10, 0.1),
labels = dollar_format(accuracy = 0.1, suffix = "/€")) +
scale_color_manual(values = viridis(5)[1:4]) +
theme(legend.position = c(0.8, 0.80),
legend.title = element_blank())
Quarterly
Code
"https://sdw-wsrest.ecb.europa.eu/service/data/EXR/Q.USD.EUR.SP00.A" %>%
readSDMX() %>%
%>%
as_tibble quarter_to_date() %>%
ggplot(.) + geom_line(aes(x = date, y = obsValue)) +
theme_minimal() + xlab("") + ylab("") +
scale_x_date(breaks = seq(1960, 2026, 2) %>% paste0("-01-01") %>% as.Date,
labels = date_format("%Y")) +
scale_y_continuous(breaks = seq(0, 10, 0.1),
labels = dollar_format(accuracy = 0.1, suffix = "/€")) +
scale_color_manual(values = viridis(5)[1:4]) +
theme(legend.position = c(0.8, 0.80),
legend.title = element_blank())
Financial Markets
Euribor 1-year
Source: https://sdw.ecb.europa.eu/quickview.do?SERIES_KEY=143.FM.M.U2.EUR.RT.MM.EURIBOR1YD_.HSTA
Code
"https://sdw-wsrest.ecb.europa.eu/service/data/FM/M.U2.EUR.RT.MM.EURIBOR1YD_.HSTA" %>% readSDMX() %>% as_tibble %>%
mutate(obsTime = zoo::as.yearmon(obsTime, format = "%Y-%m")) %>%
+ geom_line(aes(x = obsTime, y = obsValue/100)) +
ggplot xlab("") + ylab("Euribor 1-year") + theme_minimal() +
::scale_x_yearmon(format = "%Y-%m") +
zootheme(legend.position = c(0.65, 0.25),
legend.title = element_blank()) +
scale_y_continuous(breaks = 0.01*seq(-100, 90, 0.5),
labels = scales::percent_format(accuracy = .1)) +
geom_hline(yintercept = 0, linetype = "dashed")
Interest rates
Interest rate on minimum reserves
Code
"https://sdw-wsrest.ecb.europa.eu/service/data/BSI/M.U2.N.E.IRR.X.X.U2.0000.Z0Z.I" %>% readSDMX() %>% as_tibble %>%
mutate(obsTime = zoo::as.yearmon(obsTime, format = "%Y-%m")) %>%
+ geom_line(aes(x = obsTime, y = obsValue/100)) +
ggplot xlab("") + ylab("Interest rate on minimum reserves") + theme_minimal() +
::scale_x_yearmon(format = "%Y-%m") +
zootheme(legend.position = c(0.65, 0.25),
legend.title = element_blank()) +
scale_y_continuous(breaks = 0.01*seq(-100, 90, 0.5),
labels = scales::percent_format(accuracy = .1)) +
geom_hline(yintercept = 0, linetype = "dashed")
Reserves, required and excess, Current Account
Linear
Code
"https://sdw-wsrest.ecb.europa.eu/service/data/BSI/M.U2.N.R.LRR.X.1.A1.3000.Z01.E" %>% readSDMX() %>% as_tibble %>%
bind_rows("https://sdw-wsrest.ecb.europa.eu/service/data/BSI/M.U2.N.R.LRE.X.1.A1.3000.Z01.E" %>% readSDMX() %>% as_tibble) %>%
bind_rows("https://sdw-wsrest.ecb.europa.eu/service/data/ILM/M.U2.C.L020100.U2.EUR" %>% readSDMX() %>% as_tibble) %>%
rename(OBS_VALUE = obsValue) %>%
%>%
month_to_date mutate(OBS_VALUE = OBS_VALUE/1000) %>%
+ geom_line(aes(x = date, y = OBS_VALUE, color = TITLE)) +
ggplot ylab("Required and Excess reserves") + xlab("") + theme_minimal() +
theme(legend.position = c(0.45, 0.9),
legend.title = element_blank()) +
scale_y_continuous(breaks = seq(0, 10000, 500),
labels = dollar_format(acc = 1, pre = "", su = "Bn€")) +
scale_x_date(breaks = as.Date(paste0(seq(1940, 2030, 2), "-01-01")),
labels = date_format("%Y"))
Log
Code
"https://sdw-wsrest.ecb.europa.eu/service/data/BSI/M.U2.N.R.LRR.X.1.A1.3000.Z01.E" %>% readSDMX() %>% as_tibble %>%
bind_rows("https://sdw-wsrest.ecb.europa.eu/service/data/BSI/M.U2.N.R.LRE.X.1.A1.3000.Z01.E" %>% readSDMX() %>% as_tibble) %>%
bind_rows("https://sdw-wsrest.ecb.europa.eu/service/data/ILM/M.U2.C.L020100.U2.EUR" %>% readSDMX() %>% as_tibble) %>%
rename(OBS_VALUE = obsValue) %>%
%>%
month_to_date mutate(OBS_VALUE = OBS_VALUE/1000) %>%
+ geom_line(aes(x = date, y = OBS_VALUE, color = TITLE)) +
ggplot ylab("Required and Excess reserves") + xlab("") + theme_minimal() +
theme(legend.position = c(0.45, 0.9),
legend.title = element_blank()) +
scale_y_log10(breaks = 10^(seq(0, 10, 1)),
labels = dollar_format(acc = 1, pre = "", su = "Bn€")) +
scale_x_date(breaks = as.Date(paste0(seq(1940, 2030, 2), "-01-01")),
labels = date_format("%Y"))
Bank Lending Statistics
Loan demand - Weighted net percentage
Code
"https://sdw-wsrest.ecb.europa.eu/service/data/BLS/Q.U2.ALL.Z.H.H+C.B3.ZZ.D.WFNET" %>%
readSDMX() %>%
%>%
as_tibble mutate(obsTime = zoo::as.yearqtr(obsTime, format = "%Y-Q%q")) %>%
+ geom_line(aes(x = obsTime, y = obsValue/100, color = BLS_COUNT_DETAIL)) +
ggplot xlab("") + ylab("Loan demand - Weighted net percentage") + theme_minimal() +
::scale_x_yearqtr(format = "%YQ%q") +
zootheme(legend.position = c(0.65, 0.25),
legend.title = element_blank()) +
scale_y_continuous(breaks = 0.01*seq(-100, 90, 10),
labels = scales::percent_format(accuracy = 1)) +
geom_hline(yintercept = 0, linetype = "dashed")