ECB chnaged their API without telling anyone... (Ok, its an internal API, but I still dont like it!)

This commit is contained in:
Dominik Moritz Roth 2024-01-14 16:58:36 +01:00
parent 89636040c6
commit ecb387a467

View File

@ -81,8 +81,10 @@ def reload(maxCacheSeconds=3600):
def _loadYearsTableWeb(): def _loadYearsTableWeb():
print('[i] Fetching new data from ECB-Servers...') 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' #url = 'https://sdw.ecb.europa.eu/quickviewexport.do?SERIES_KEY=122.ICP.M.U2.N.000000.4.ANR&type=csv'
resp = requests.get(url) #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:] lines = resp.text.split('\n')[6:]
years = defaultdict(lambda: {m:1 + 0.02/12 for m in range(1,13)}) years = defaultdict(lambda: {m:1 + 0.02/12 for m in range(1,13)})
for line in lines: for line in lines: