From ecb387a46730613a84b164f69fe6a46edb9d88dd Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sun, 14 Jan 2024 16:58:36 +0100 Subject: [PATCH] ECB chnaged their API without telling anyone... (Ok, its an internal API, but I still dont like it!) --- meuro.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meuro.py b/meuro.py index c6b2738..60ca8ab 100755 --- a/meuro.py +++ b/meuro.py @@ -81,8 +81,10 @@ def reload(maxCacheSeconds=3600): def _loadYearsTableWeb(): print('[i] Fetching new data from ECB-Servers...') - url = 'https://sdw.ecb.europa.eu/quickviewexport.do?SERIES_KEY=122.ICP.M.U2.N.000000.4.ANR&type=csv' - resp = requests.get(url) + #url = 'https://sdw.ecb.europa.eu/quickviewexport.do?SERIES_KEY=122.ICP.M.U2.N.000000.4.ANR&type=csv' + #resp = requests.get(url) + url = 'https://data.ecb.europa.eu/download-api/csv/wide' + resp = requests.post(url, {'serieskeys': ['ICP.M.U2.N.000000.4.ANR']}) lines = resp.text.split('\n')[6:] years = defaultdict(lambda: {m:1 + 0.02/12 for m in range(1,13)}) for line in lines: