For a deeper look into our Eikon Data API, look into:
Overview | Quickstart | Documentation | Downloads | Tutorials | Articles
Hi, i need to get 20 year of montly total returns from a little over 5000 Sedols. Right now i'm using this method with the Python API:
aux, err = ek.get_data(list, ['TR.TotalReturn.Date','TR.TotalReturn'], parameters={"Frq": "M",'SDate':'1998-12-31', 'EDate':'2018-12-31'})
but i keep getting this error message:
"headers = [header['displayName'] for header in data_dict['headers'][0]]"
I tried partitioning the the quering on batches of 200, 100 and 50 Sedols, but i still get the same error. Retrying would get more or less iterations randomly (ie, with 100 on my first try i got the first 500 and on the second over a 2000).
Any thoughts?
Hi @pchauveau
I have tried with the code below and got the outputs
instruments, e = ek.get_data('0#.GDAXI', ['Instrument']) instruments=instruments['Instrument'].tolist() for ric in instruments: tmp_df = ek.get_data(ric, ['TR.TotalReturn.Date','TR.TotalReturn'], parameters={"Frq": "M",'SDate':'1998-12-31', 'EDate':'2018-12-31'})[0] df = tmp_df.append(df) df
This is a known issue where the Web service provides an empty response when the backend takes "too long" to process the request. The problem is acknowledged and is being worked on. In the meantime as a workaround the suggestion is to split your list into even smaller chunks (submitting the request of say 20 Sedols at a time), and also resending the same request if and when you receive an empty response.
The issue with the Web service returning empty response or "Backend error. 400 Bad Request" has been addressed with the release of Eikon Data APIs library for Python v1.0.1 available on PyPI. This does not mean that with Eikon Data APIs library for Python v1.0.1 one can never receive "Bad request" error or that the service can now provide unlimited data downloads. But one should no longer experience random and frequent empty responses or "Backend error. 400 Bad Request" forcing one to resubmit the same requests in a loop until the data is returned.