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 0

Retrieving company data items from LEI code

Hi,

From a list of LEI codes, how can I get the data items for those companies with a workspace licence using worksphace APIs?


Thanks.

eikon-data-api#product#content
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.

1 Answer

· Write an Answer
Upvote
Accepted
1.4k 5 3 6

Hi @asli.sahin

For that purpose you can use refinitiv.data library and convert the LEI codes to RIC codes which can be later on used as standard inputs in api.

import refinitiv.data as rd
rd.open_session()

rd.get_data("213800TB53ELEUKM7Q61@LEI","TR.RIC")
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.

Thanks very much @m.bunkowski

And from there 1) How do I bring the data items related 2) if it is a list of LEI instead of only one, how do I need to add the list of LEI in the code?

Many thanks

Hi @asli.sahin01

If you insist on using the list of LEI codes you can do it like this:

lei_codes = ['213800TB53ELEUKM7Q61','213800LH1BZH3DI6G760','2138002P5RNKC5W2JZ46']
lei_codes_2 =  [f'{lei}@LEI' for lei in lei_codes]
rd.get_data(lei_codes_2,"TR.RIC,TR.COMMONNAME,TR.CLOSEPRICE,TR.DIVIDENDYIELD")

However it is recommended to use the RIC codes and here is how you can easily tranform a LEI list to a RIC list

df = rd.get_data(lei_codes_2,"TR.RIC")
rics = df['RIC'].tolist()

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.