Get data of "TR."-variables using Python API of Datastream Web Services (dsws)

Eikon10
Newcomer
in Datastream
Hi everyone,
I try to get mean analyst forecasts for a specific company (Volkswagen) as a daily time series. When I do this in Excel, this works with the variable "TR.EPSMean". The respective excel formula is:
TR("VOWG_p.DE";"TR.EPSMean;TR.EPSPeriodMonth;TR.EPSPeriodYear";"Period=FY1 Frq=D SDate=2010-01-01 EDate=2021-11-02 CH=Fd RH=IN;date";B2)
The output looks like this:
Now I try to replicate this using python and the Datastream Web Services API. I tried the following:
import DatastreamDSWS as dsws
ds = dsws.Datastream(username='<USERNAME>', password='<PASSWORD>')
data=ds.get_data(tickers='<VOWG_p.DE>',fields=['TR.EPSMean'], start='-10Y',kind=1)
Unfortunately, this returns simply "None" for the variable TR.EPSMean, Whats my mistake here?
Thank you very much for your help in advance!
Tagged:
0
Best Answer
-
Hello @Eikon10,
Please see the Datastream Navigator for the list of fields that can be used for your instrument. Here is a sample request -
>>> df1 = ds.get_data(tickers='<VOWG_p.DE>', fields=['AF', 'CAI', 'DSCD', 'GEOG', 'ISIN', 'LOC', 'SECD', 'ACUR', 'ECUR', 'PYD', 'LYE', 'DEF', 'DY', 'EXDSCD', 'EXMNEM', 'EPS', 'EPSD', 'EPSF', 'EPSFD', 'Estat', 'EXNAME', 'ECNAME', 'ENAME', 'EPS1D', 'EPS2D', 'MVFF', 'GEOGC', 'GEOGN', '897E', '400E', 'ISINID', 'ISOCUR', 'MV', 'MVC', 'EPS1', 'EPS2', 'MNEM', 'NAME', 'WC01001', 'WC01001A', 'NOSH', 'EPS1PER', 'EPS2PER', 'PA', 'PB', 'PCUR', 'PH', 'PHP', 'PL', 'OP'], kind=1)
>>> df1
Instrument <VOWG_p.DE> ...
Field AF CAI DSCD GEOG ISIN LOC SECD ... PA PB PCUR PH PHP PL OP
Dates ...
2020-11-02 1 10.35 None None None None None ... 127.76 127.68 None 128.92 128.92 122.96 133.8
2020-11-03 1 10.35 None None None None None ... 131.94 131.88 None 132.68 132.68 129.14 133.8
2020-11-04 1 10.35 None None None None None ... 131.76 131.68 None 133.10 133.10 127.28 133.8
2020-11-05 1 10.35 None None None None None ... 136.04 135.96 None 136.50 136.50 132.62 133.8
2020-11-06 1 10.35 None None None None None ... 133.40 133.32 None 136.44 136.44 132.62 133.8
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
2021-10-27 1 10.35 None None None None None ... 204.20 204.10 None 206.85 206.85 200.10 133.8
2021-10-28 1 10.35 None None None None None ... 195.70 195.62 None 200.40 200.40 194.18 133.8
2021-10-29 1 10.35 None None None None None ... 193.38 193.32 None 195.96 195.96 191.86 133.8
2021-11-01 1 10.35 None None None None None ... 194.68 194.64 None 196.02 196.02 193.00 133.8
2021-11-02 1 10.35 None None None None None ... 194.02 193.98 None 195.60 195.60 192.62 133.8
[262 rows x 50 columns]
>>>
>>>
>>> df2 = ds.get_data(tickers='<VOWG_p.DE>', fields=['PO', 'P', 'PI', 'PTBV', 'APC', 'PC', 'PE1', 'PE2', 'PE', 'PG1', 'PG2', 'TIME', 'RI', 'VO', 'TYPE', 'UP', 'P.U'], kind=1)
>>> df2
Instrument <VOWG_p.DE> ...
Field PO P PI PTBV APC PC PE1 ... PG2 TIME RI VO TYPE UP P.U
Dates ...
2020-11-02 126.26 127.78 556.2 0.58 None 1.83 None ... None None 1039.65 1262.8 None 127.78 None
2020-11-03 129.66 131.74 573.4 0.59 None 1.89 None ... None None 1071.87 1180.0 None 131.74 None
2020-11-04 128.50 132.08 574.9 0.59 None 1.89 None ... None None 1074.64 1527.2 None 132.08 None
2020-11-05 133.94 135.92 591.6 0.61 None 1.95 None ... None None 1105.88 1468.2 None 135.92 None
2020-11-06 135.00 133.16 579.6 0.60 None 1.91 None ... None None 1083.42 1279.9 None 133.16 None
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
2021-10-27 205.50 203.90 887.5 0.92 None 2.92 None ... None None 1697.64 793.6 None 203.90 None
2021-10-28 199.46 194.78 847.8 0.88 None 2.79 None ... None None 1621.70 1442.6 None 194.78 None
2021-10-29 194.28 193.82 843.7 0.87 None 2.78 None ... None None 1613.71 1222.3 None 193.82 None
2021-11-01 194.76 194.66 847.3 0.88 None 2.79 None ... None None 1620.70 676.1 None 194.66 None
2021-11-02 194.88 193.44 842.0 0.87 None 2.77 None ... None None 1610.55 891.7 None 193.44 None
[262 rows x 17 columns]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
- 690 Datastream
- 1.4K DSS
- 629 Eikon COM
- 5.2K Eikon Data APIs
- 11 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 255 ETA
- 559 WebSocket API
- 39 FX Venues
- 15 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 24 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 279 Open PermID
- 45 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 23 RDMS
- 2K Refinitiv Data Platform
- 713 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
- 106 UPA
- 194 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 95 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛