Find out if a company is listed on multiple exchanges using the Python API?

Is there a way to determine if a company is listed on multiple exchanges using the Python API? Currently I can find out where a company is based:

ek.get_data(['RIO.AX'], ['CF_NAME', 'TR.CompanyMarketCap', 'TR.HeadquartersCountry'],
{'SDate': '0CY'})

However, I haven't been able to find a way to determine if this company is also on another exchange (in this case, Rio Tinto is based in Australia, but also on the London exchange).

Best Answer

  • Since there is not really a searching capability within the API, the only way I found to achieve this is a little rusty. The key is to use the raw output of the get_symbology function, and use the ISIN as an input:

    tr.get_symbology(['AU000000RIO1'], to_symbol_type='RIC', raw_output=True, bestMatch=False)

    image

    You can ignore the RICs with hat suffixes, these are delisted shares, where the first letter is the month code and the year (you can look them up on RULES2 page in the quote app on Eikon).