question

Upvotes
Accepted
3 1 1 1

How to find Country of Risk based on RIC code with Datastream Python API?

The country of risk can be obtained using the datastream excel add-in with the function: =TR(RIC code,"TR.CoRPrimaryCountry"), whereas I cannot find how to retrieve the country of risk for a countryparty with the Python API.

datadatastream-apidsws-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.

Hello @Salih.Bagci

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

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

1 Answer

· Write an Answer
Upvotes
Accepted
5.7k 21 2 6

Dear Bagci,

"TR.CoRPrimaryCountry" is a field used to collect data (in this case: 'Country of Risk') from Refinitiv Workspace (a.k.a.: Eikon). This field can be used with the Eikon Data API for any stock (e.g.: Apple with the RIC '@AAPL') via the following code in Python:


import eikon as ek
ek.set_app_key("insert eikon key here")
df, err = ek.get_data(instruments = ['@AAPL'],
                      fields = ['TR.CoRPrimaryCountry'],
                      parameters = {'SDate':'0',
                                    'EDate':'-19',
                                    'Period':'FY0',
                                    'Frq':'FY'})
df


Datastream dos not - unfortunately - have such a field. You may find a list of all the fields available from Datastream in the document attached: Datastream fields for AAPL.txt


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.