Hello , How to get S&P500 all stock by phthon API ? thank you.
Hi @ethan.hayashi
You can retrieve index RIC constituents along with their names using the syntax
ek.get_data("0#.SPX","TR.COMMONNAME")
Thank you~ It is worked.
@ethan.hayashi, another way is to query the fundamental database for index constituents (current or historical):
ek.get_data('.SPX', 'TR.IndexConstituentRIC')
Thank you~ It is worked too.