Use Autosuggest capabilities to resolve a list of companies with rd library

Hi guys,

Hope you are doing well.


With Codebook, I'm trying by using RD library to build a python script which will resolve a list of companies.

Broadly speaking, the script will parse a list of company name and will return the corresponding RIC or ISIN or Parent ID


Example:

with the list below:

+-----------------------------------------------------------+

| Company name |

+-----------------------------------------------------------+

| Arla Insurance Company (Guernsey) Limited |

+-----------------------------------------------------------+

| Swiss Re Europe S.A. |

+-----------------------------------------------------------+

| Stena Insurance AG |

+-----------------------------------------------------------+



I want to retrieve

+-----------------------------------------------------------+----------------------------+

| Company name | Company permID |

+-----------------------------------------------------------+----------------------------+

| Arla Insurance Company (Guernsey) Limited | 5036231548 |

+-----------------------------------------------------------+----------------------------+

| Swiss Re Europe S.A. | 4295934474 |

+-----------------------------------------------------------+----------------------------+

| Stena Insurance AG | 5000134472 |

+-----------------------------------------------------------+----------------------------+





Can you advice how I can do that?


Best Answer

  • raksina.samasiri
    Answer ✓

    Hi @yaokoffi.kouassi ,

    You may use Advanced Search as a helper to form the query, the step-by-step guide can be found in article Find content and functionality using Refinitiv Data Library with Eikon Advanced Search

    Here's an example search, I've edited the first two companies' name a bit to let the result returned

    1716447681341.png

    from this, the code from export query option it as below, you can adjust the columns to be shown in select parameter and edit top parameter to return more than 10 rows of result

    import refinitiv.data as rd
    rd.open_session()

    rd.discovery.search(
    view = rd.discovery.Views.ORGANISATIONS,
    top = 10,
    filter = "( SearchAllCategoryv2 eq 'Companies/Issuers' and (DTSubjectName in ('Stena Insurance AG' 'Arla Insurance Company' 'Swiss Re Europe SA')))",
    select = "CommonName,Gics,RCSOriginalAccountsCurrencyLeaf,PrimaryRIC,Orgid,BondsCount,CdsCount,EquitiesCount,FundsCount,FuturesCount,LoanCount,MortgagesCount,OptionsCount,WarrantsCount,OAPermID,OwnershipExists,OrganisationStatus,MktCapCompanyUsd,RCSFilingCountryLeaf,RCSTRBC2012Leaf,UltimateParentOrganisationOrgid,UltimateParentCompanyOAPermID,RatingX1XRatingRank,BusinessEntity,PI,SearchAllCategoryv3,SearchAllCategoryv2,SearchAllCategory,DTSubjectName,UltimateParentOrganisationName,DTSimpleType,RCSOrganisationSubTypeLeaf,RCSCountryHeadquartersLeaf"
    )

    1716447854389.png