I need to fetch data from following 2 links for my analysis :
- https://data.ecb.europa.eu/data/datasets/BSI/BSI.M.U2.Y.V.M20.X.1.U2.2300.Z01.E
- https://data.ecb.europa.eu/data/datasets/RTD/RTD.M.JP.Y.M_M2.J
I have never worked with SDMX library before and I am having trouble understanding the documentation. According to my understanding from this link, I tried to put the following code together but it is not working, I get 404 error.
resource = 'data' # The resource for data queries is always 'data'
flowRef ='BSI' # Dataflow describing the data that needs to be returned
key = 'M.U2.Y.V.M20.X.1.U2.2300.Z01.E' # series key for M2 euro area
# Define the parameters
parameters = {
'startPeriod': '2010-01-01', # Start date of the time series
'endPeriod': '2024-07-20', # End of the time series
'detail' : 'dataonly'
}
request_url = entrypoint + resource + '/'+ flowRef + '/' + key
response = requests.get(request_url, params=parameters)
print(response)
I also tried the following code after seeing – how to download data from ECB using pandaSDMX?
datamessage = sdmx.Request('ECB').data(
resource_id='BSI',
key='M.U2.Y.V.M20.X.1.U2.2300.Z01.E',
params=dict(startPeriod='2010-04-01', endPeriod='2024-07-20'),
)
df = sdmx.to_pandas(datamessage)
2 pieare is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.