Backend error. 400 Bad Request

Hi,
I've been having this problem since Monday with the different codes and it used to work properly (Backend error. 400 Bad Request, HTTP request failed: EikonError-Backend error. 400 Bad Request). Is there a problem with the server connection?
Here is an example:
def descargar_info(rics,fecha_inicio,fecha_final, fields_papel, decision, historico,ric_por_llamado, nombre_archivo):
#decision=1 descargar informacion
#decision <> 1 tomar archivo ya descargado
#historico = 0, datos a 1 fecha especifica
#historico <> 0 datos historicos periodicidad diaria
if decision==1:
array_ric_list = []
ric_per_call = ric_por_llamado
h = 0
while h < len(rics)/ric_per_call:
array_ric_list.append(rics[h*ric_per_call:(h+1)*ric_per_call])
h += 1
parametros = pd.DataFrame()
h = 1
for riccodes in array_ric_list:
start_time2 = datetime.now()
print("grupo "+ str(h)+ '/'+str(len(array_ric_list)))
if historico == 0:
ts1,e1 = ek.get_data(riccodes, fields_papel,{'SDate':fecha_final,'EDate':fecha_final,'Frq':'D'})
else:
ts1,e1 = ek.get_data(riccodes,fields_papel,{'SDate':fecha_inicio,'EDate':fecha_final,'Frq':'D','NULL' : 'prev'})
parametros = pd.concat([parametros,ts1], axis=0)
time.sleep(5) #delay between each API call
end_time = datetime.now()
print('Duration: {}'.format(end_time - start_time2))
h = h+1
parametros.reset_index(drop=True, inplace=True)
parametros.to_csv(nombre_archivo, index=False)
else:
parametros = pd.read_csv(nombre_archivo)
return parametros
fields_papel = ["TR.MODIFIEDDURATION","TR.FiFitchsRating",
"TR.FiMoodysRating", "TR.RiskCountryCode",
"TR.FiMaturityDate", "TR.TRBCEconomicSector", "TR.CommonName"] parametros=descargar_info(rics,today,today, fields_papel, descargar, 0,15, "parametros.csv")
Answers
-
Thank you for reaching out to us.
According to the Eikon Data API Usage and Limits Guideline:
When a request fails because the platform is overwhelmed, an HTTP response with status code 400 and the message "Backend error. 400 Bad Request" is returned. Then the Python library raises an EikonError exception with the following message:.
The application may reduce the number of items in the request or implement try/except to catch this exception and then retry, as shown in this discussion.
0 -
Hello @Jirapongse,
Thanks for replying. I've been executing these codes for over two years, and it used to work properly. The code already limits the quantity of RICS per request, but it doesn't work. I've been reading this forum and there are other people asking for the same error (for example get_lots_of_data function for the Pyhton LSEG Data Library - LSEG Developer Community).
Is there an error on the server connection?
Thanks in advance for your help.
0 -
If the error is "Backend error. 400 Bad Request", it should be the problem on the backend, not in the code, as mentioned on this guideline.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 250 ETA
- 554 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 643 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛