Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 1

How to query Earnings WTD from SPX and MSCI BRAZIL by year

On Excel I use DSGRID("S&PCOMP";"afcmn2019;afcmn2020;afcmn2021;afcmn2022") and

DSGRID("msbrazl";"afcmn2019;afcmn2020;afcmn2021;afcmn2022"). How to query on python using ek.get_data?

eikoneikon-data-apirefinitiv-dataplatform-eikonworkspaceworkspace-data-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@felipe.diogenes

Hi,

Thank you for your participation in the forum.

Is the reply below satisfactory in answering your question?

If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,


AHS

1 Answer

· Write an Answer
Upvotes
Accepted
39.4k 77 11 27

This data comes from Datastream Web Service. To retrieve it you need to use DatastreamDSWS library. For documentation see Getting Started Guide. You may also want to check out the video titled Build Financial Models in Python using Datastream Web Service.
Here's the code snippet that retrieves the data you're interested in

import DatastreamDSWS as dsws
ds = dsws.Datastream(username='my_username', password='my_password')
ds.get_data (tickers='S&PCOMP, MSBRAZL', 
             fields=['AFCMN2019','AFCMN2020','AFCMN2021','AFCMN2022'])
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.