Hello , How to get S&P500 all stock by phthon API ? thank you.
For a deeper look into our Eikon Data API, look into:
Overview | Quickstart | Documentation | Downloads | Tutorials | Articles
Hello , How to get S&P500 all stock by phthon API ? thank you.
Hi @ethan.lin
You can retrieve index RIC constituents along with their names using the syntax
ek.get_data("0#.SPX","TR.COMMONNAME")
@ethan.lin, another way is to query the fundamental database for index constituents (current or historical):
ek.get_data('.SPX', 'TR.IndexConstituentRIC')