I am trying to get ESG data for indices for example 'SPX', using the following code:
etf_esg, err = ek.get_data('SPX',
However, it returns only NaN values in Python.
How can I retrieve data properly?
Hi @Rupert.Geyang - thanks for your question. ESG Scores are provided at a company level. So if you wanted to check out a particular index - then you would get the constituents of that index and then get the ESG scores for all the constituents and then maybe provide an aggregate score weighted by either marketcap or revenue or profit etc. You can get the constituents of an index by providing a chain RIC - in the case of SPX that is '0#.SPX'
etf_esg, err = ek.get_data('0#.SPX', ['TR.TRESGScore','TR.TRESGScoreGrade','TR.ESGCScore',"TR.TRESGCScoreGrade",'TR.EnvironmentPillarScore','TR.SocialPillarScore','TR.fdfdf','TR.TRESGResourceUseScore'])
I hope this can help.
We also have an article on how to use ESG data overtime as you might find that of interest.
SPX is not a valid RIC code.
However .SPX -- (dot)SPX is a valid RIC code.
You can use "Data Item Browser" to double confirm that the data field is not available on .SPX
For example, on TR.TRESGScore data field.
@chavlit.jintamalit, you need to use the Funds API in RDP to get the ESG for SPY. The ESG data is from Lipper (by aggregation of the ESG scores held by the underlying assets of fund) and Lipper provides all fund level data in RDP via the Funds API.