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?

Best Answer

  • wasin.w
    wasin.w admin
    Answer ✓

    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.

Answers

  • 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.

  • 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]

  • Hello @r.patel

    Does the issue still persist in your environment?