Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 1 1 0

[MainThread 47708] Backend error. 400 Bad Request

I am attempting to download some data using the Eikon python package (version == 1.1.2 due to some issues with more recent versions), however it is very hit or miss whether I actually receive a response from the Eikon servers. Very frequently I get the 400 error (bad request) and when I do receive a response frequently many, if not all, the values in my resulting dataframe are "na". Is there anything I can do to ensure I receive prompt and complete data?

Code to Reproduce:

import eikon as ek
ek.set_app_key("YOUR KEY HERE")
for years_back in range(25):
    year = str(2020 - years_back)
    print(year)
    s, e = 365 * years_back, 365 * years_back + 1
    data, err = ek.get_data(tickers,
                            fields=['AVG(TR.PriceToSalesPerShare(SDate=-{s},EDate=-{e},Frq=D))'.format(s=s, e=e),
                                    'AVG(TR.CompanyMarketCap(Curn=USD,SDate=-{s},EDate=-{e},Frq=D))'.format(s=s, e=e),
                                    'AVG(TR.DailyValueTraded(Curn=USD, SDate=-{s},EDate=-{e},Frq=D))'.format(s=s, e=e),
                                    'TR.CoRPrimaryCountry'])
    



Environment:

conda version : 4.8.4

pip: 20.2.2

platform : win-64

eikon: 1.1.2

pandas: 1.1.1


eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apierror-400
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@mcooper

Hi,

Thank you for your participation in the forum.

Is the reply below satisfactory in answering your question?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

1 Answer

· Write an Answer
Upvotes
Accepted
39.4k 77 11 27

This error is most likely due to timeouts on the backend. The requests you're submitting are fairly taxing on the backend, which is required to retrieve daily timeseries for each of the fields and aggregate them (calculate the average). I would suggest to try reducing the number of tickers in each request. I appreciate this may increase the overall retrieval time, but this is pretty much the only thing you can do from the client side to improve the success rate of these requests. If this workaround is not acceptable, then I would suggest using Fiddler to capture a few requests that return "Bad request" or nulls, and then opening a support case with Refinitiv Helpdesk, so that Refinitiv Support could investigate the backend errors.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.