Response: Backend error. 400 Bad Request

Dear Community,

so I recently started to play around with the Python Eikon Interface. Unfortunately for my latest code, I get a Backend error: 400 Bad Request - Honestly I don't know why. Funnily, it worked two days ago ...

My goal ist to split a list I have in even chunks of 1000 values per list and then get the data. Listdf is a flat list with RICS in the proper format. Thanks in advance.

chunksize = 1000
for i in range (0, len(listdf), chunksize):
chunk = listdf[i:i+chunksize]
list2 =[]
for i in range (0, len(listdf), chunksize):
list2.append(ek.get_data(listdf[i:i+chunksize], ["TR.Revenue"]))

Best Answer

  • Jirapongse
    Jirapongse admin
    Answer ✓

    If the request failed periodically, it could be timeout.

    As I know, for the DataGrid service used by get_data, there is around 19 seconds' time-frame to execute the request. If it takes more than 19 seconds, it will return 400 Bad Request.

    You may try to reduce the chucksize.

Answers

  • I am facing the same issue since 2 days for trying to fetch closePrice for single day only, for list of RIC's. After few request i get the famous 400 bad request.server error whereby i reduce the chucksize drastically (tried all from 1 to 500 chunksizes) but the request keeps failing with the same error? Is there any way to reproduce this at you end and some workaround this ?