I'm working with the EK API to get ESG data with market and fundamentals data for a company (e.g., AAPL.O). My goal is to pull fields related to price, market cap, ESG scores, and Scope 1 emissions (and other extra-financial data). I have problem aligning the dates. Here is the code I'm using:
fields = [ 'TR.PriceClose', 'TR.PriceClose.date', 'TR.CompanyMarketCap', 'TR.CompanyMarketCap.date', 'TR.TRESGCScoreGrade', 'TR.TRESGCScoreGrade.date', 'TR.Scope1EstTotalToEVIC','TR.Scope1EstTotalToEVIC.date' ] pd1 = { 'SDate': '0', 'Frq': 'FY', 'EDate': '-20', 'Period': 'FY0', 'AddSource': 'True', 'IncludePartialYear': 'True' } df, err = ek.get_data( instruments = ['AAPL.O'], fields = fields, parameters = pd1 )
The data retrieval works, but I am unsure how to best align the ESG data with market and fundamentals data over the same period. How can I ensure that these different data types (price, market cap, ESG scores, emissions) are correctly aligned over time?
The output provides different dates for each variable. I am getting price and Market Cap for December for the ESG scores that were reported in September. In this case, GHG and ESG data where reported the same date, I don't know if this holds for other extra-financial data, which will make it worst.
This gap is exacerbated when 'IncludePartialYear': 'False' or
pd1={'SDate':'2001-01-01','Frq':'FY', 'EDate':'2024-01-01', 'Period':'FY0'}
Any suggestions on how to approach this or pointers to relevant documentation would be greatly appreciated.
Thanks in advance!