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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 1 1

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-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikon
icon clock
10 |1500

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

Upvotes
Accepted
38.1k 71 35 53

@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 5.0 MiB each and 10.0 MiB total.

Upvotes
18k 21 12 20

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 5.0 MiB each and 10.0 MiB total.

Upvotes
6.7k 8 6 7

@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 5.0 MiB each and 10.0 MiB total.

I am getting refinitiv module does not exist

Upvotes
6.7k 8 6 7

@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 5.0 MiB each and 10.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 0 1 1

@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 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea