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 3 3 3

Is it possible to get a company's ticker with just the name enter by an user input?

Here is my code. I want to get the company's ticker when a user input the company name. It seems not bee working as I get NONE

company_name = ['entry2']

company_ticker, err =

ek.get_data(['SCREEN(U(IN(Equity(active,public,primary))),Contains(TR.CommonName,"company_name"))'], ['TR.CommonName'])

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.

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

Upvotes
Accepted
78.8k 250 52 74

@maxwilliams.boko

I hope that this is what you are looking for.

company_name = "Voda"
screener_exp = 'SCREEN(U(IN(Equity(active,public,primary))),Contains(TR.CommonName,"{}"))'.format(company_name)

company_ticker, err = ek.get_data(instruments=[screener_exp], fields = ['TR.RIC','TR.CommonName','TR.TickerSymbol'])
company_ticker

There are other ways to insert values into strings.

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.

Upvotes
18.2k 21 13 21

Hi @maxwilliams.boko

I think you may consider search() from RDP Library.

Please review this article.

You can try the RDP Library by launching CODEBOOK app.

Just type "CODEBOOK" on Eikon Search bar and launch the app.

Then browse to \Examples\02-Refinitiv Data Platform Library/1-5.0 - Function Search sample notebook.


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.

Upvotes
10.2k 18 6 9

@maxwilliams.boko you should use the RDP search service instead (which you can access via your eikon appkey):

import refinitiv.dataplatform as rdp
session = rdp.open_desktop_session('YOUR APPKEY HERE')
company_name = 'vodafone'
df = rdp.search(
    view = rdp.SearchViews.Quotes,
    query = company_name
)

print(df['RIC'][0])

I hope this can help.



1618567873307.png (2.2 KiB)
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.

I am getting refinitiv module does not exist

Upvotes
10.2k 18 6 9

@maxwilliams.boko you need to pip install refinitiv.dataplatform from python prompt. You can also check our quickstart guide. I hope this can help

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.

It is still not working. I think there should be a way to pass company_name = ['entry2'] in the code to get the company's name.

company_name = ['entry2']

company_ticker, err =

ek.get_data(['SCREEN(U(IN(Equity(active,public,primary))),Contains(TR.CommonName,"company_name"))'], ['TR.CommonName'])

Upvotes
1 3 3 3

@jason.ramchandani Thanks for your help. However, I am sure I can use the first code I provided. However, I don’t know how to pass the user entry into the code. I saw somewhere that’s it is possible to use %s something like that

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.