Error fetching data for given date. Error code -1 | Backend error. 400 Bad Request Requested univers
Hello
I am running an Eikon API code through Python to generate Excel output for different indices every quarter from 2000-2022.
However, on several occasions, the code generates the following error on a given date:
Error fetching data for 2012-10-01: Error code -1 | Backend error. 400 Bad Request Requested universes: ['0#.FTSE(20121001)']. Requested fields: ['TR.COMMONNAME', 'TR.ISINCODE', 'TR.ENVIRONMENTPILLARSCORE(SDATE=2012-10-01)', 'TR.SOCIALPILLARSCORE(SDATE=2012-10-01)', 'TR.GOVERNANCEPILLARSCORE(SDATE=2012-10-01)', 'TR.TRESGSCORE(SDATE=2012-10-01)', 'TR.TRESGSCOREGRADE(SDATE=2012-10-01)', 'TR.COMPANYMARKETCAP(SDATE=2012-10-01)', 'TR.COMPANYMARKETCAP.CURRENCY', 'TR.PRICECLOSE(SDATE=2012-10-01)', 'TR.OPENPRICE(SDATE=2012-10-01)', 'TR.SHARESOUTSTANDINGCOMMONTOTAL(SDATE=2012-10-01)', 'TR.TOTALRETURN(SDATE=2012-10-01,EDATE=2012-12-30)']
Although once the code is run again the error either changes to another date or is resolved.
Is this related to the nature of my code or Eikon API malfunction/limitation?
Thank You!
Best Answer
-
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 exception with the following message.
Therefore, you may try to catch this exception and add the retry logic, as shown in this dicussion.
0
Answers
-
Thank you, your answer is clear and satisfactory.
I am using another approach given my data set size;
Instead of the straightforward line provided in the discussionretry_max = 5
retry_count = 1
I opted for a more flexible line with
@retry(tries=3, delay=2, backoff=2)
This means there will be 3 retries, a delay of 2 seconds, and an exponential increase of 2 seconds with each retry attempt. So, for example, if the first attempt fails, it will wait 2 seconds, for the second attempt it will wait 4 seconds, and for the third attempt, it will wait 8 seconds.
I thought this might help any other person with a similar issue with API delay.2
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 中文论坛