Error fetching data for given date. Error code -1 | Backend error. 400 Bad Request Requested univ...

...erses
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.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
- 685 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
- 252 ETA
- 556 WebSocket API
- 38 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
- 651 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
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 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 中文论坛