[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
Best Answer
-
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.
0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛