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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
55 0 2 2

Client is repeatedly getting error 400 - bad request

Hello,


I have a client who is repeatedly encountering error 400 bad request codes When he tries to use the API. I took a look at his code, and at most he is requesting 5000 datapoints from ek.get_data, which is well below the 10,000 data points limit. What could be causing the error code?

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
icon clock
10 |1500

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

Hello @r.patel

Does the issue still persist in your environment?

Upvotes
Accepted
11.5k 16 7 10

Hello @r.patel

Does the issue still persist in your environment? Could you please test with the new version of Eikon Data API (1.1.7)? You can update the library with "pip install eikon==1.1.7" command.

icon clock
10 |1500

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

Upvotes
39.2k 75 11 27

Can you provide an example of the request that returns this error? The version of Eikon Data APIs library for Python would also be very helpful.

icon clock
10 |1500

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

1.1.2b0 is the version. Here is one of the requests that I make that throws an error

Index = RU2500-G

date = '2020-09-30'

date2 = date.replace("-","")

date3 = "\"{dt}\"".format(dt=date2)

Index_RICS, err = ek.get_data('Index({ind},{dt})'.format(ind=Index,dt=date3),['TR.RIC(SDate={dt})'.format(dt = date), 'TR.PortfolioShares(SDate={dt})'.format(dt = date), 'TR.PortfolioWeight(SDate={dt})'.format(dt = date)])


Index_RICS.dropna(inplace=True)

Index_RICS_List = Index_RICS['RIC'].to_list()


data = ek.get_data(Index_RICS_List,fields =

['TR.PretaxROAPercent(SDate=dt},Period=FY0,AlignType=PeriodEndDate)'.format(dt=date), 'TR.PretaxROAPercent(SDate={dt},Period=FY-1, AlignType = PeriodEndDate)'.format(dt=date)]

)[0]

Click below to post an Idea Post Idea