Error 400 and 504 - Python API - How to fetch the data for analyst estimates?
I'm using the below code to get the data but the response we're getting is not what we want . I have attached the screenshot of the code with response we're getting with the excel sheet which contain the type of response we want. Can you please help with the code to use?
df, err = ek.get_data(
instruments = ['AAPL.O'],
fields = ['TR.RevenueMean.periodenddate','TR.RevenueMean.calcdate','TR.RevenueMean.date','TR.EPSMean','TR.NetProfitMean','TR.RevenueMean']
,parameters={'SDate':'2010-01-01','EDate':'2023-10-10','Frq':'FQ'}
)
display(df)
I am getting error 400 and 504. Please advise. Thank you.
Best Answer
-
Hi @irenebandal14,
Please
(i) make sure you have the latest version of Eikon/Workspace,
(ii) make sure you have the latest version of `refinitiv.data` (via `pip install refinitiv-data --upgrade`), the latest version is 1.4.0;
(iii) import `eikon` from the `refinitiv.data` library,
(iv) authenticate yourself to the LSEG services via `ek.set_app_key("InsertAppKeyHere")` (more on the App Key here) with the Eikon or Workspace Desktop Application running on the machine where the code is being run, when using a desktop session (more on sessions here), and
(v) do not hesitate to search the LSEG Developer Q&A Forum for answers on the errors you are experiencing; concerning error 400, please see this previous discussion; concerning 504, please see here.
By searching for your error within forums, you will be able to find other relevant discussion threads, pertaining to the same.
Please note that we now advise to upgrade to the new Refinitiv Data Library for Python (RD Lib. for Python), instead of the Eikon Data API (EDAPI). This latest library, RD Lib., will receive patches and improvements faster in new releases.0
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 162 App Studio
- 4 Block Chain
- 5 Bot Platform
- 17 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
- 370 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
- 60 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛