API Is it possible to obtain company peers by specific criteria?

Hi all

I am currently using the Python API to obtain peer companies for given instruments. Is there a possibility to obtain peers based on specific criteria. I am currently only able to obtain the Starmine peers but would be interested in industry peers from a given region.

Regards

Phil

Best Answer

  • raksina.samasiri
    Answer ✓

    Hi @cctpe ,

    To filter the industrial/country of the company, fields 'TR.TRBCIndustryGroup','TR.TRBCIndustry','TR.HeadquartersCountry' can be used

    Plus, the peer companies can be retrieved with the code below.

    Then Python code can be used to filter the peer companies you would like to get

    ric = 'IBM.N'
    peers, err = ek.get_data([ric,"Peers("+ric+")"],['CF_CLOSE','CF_NAME','TR.TRBCIndustryGroup','TR.TRBCIndustry','TR.HeadquartersCountry'])
    peers

    1655959735624.png

    You may find the available fields and their description using Data Item Browser (DIB)

    Here's a video demonstrate how to use Data Item Browser

    1655959839788.png

    Hope this helps