question

Upvotes
Accepted
1 1 1 1

Data extraction with EIKON API Python

I want to extract financial data from refinitiv over the Python EIKON API. Therefore, I want to extract the following information: 'TR.CompanyMarketCap', 'TR.NetProfitMean','TR.EBITDAMean','TR.NetDebtMean','TR.EVMean','TR.RepEPSMean','TR.CompanyMarketCapitalization','TR.FiMoodysRating','TR.PRIMARYLISTINGUNADJUSTEDOPENPRICE','LIST_DATE','TR.TotalAssetsMean','TR.ROAMean','TR.NIIsVentureCapitalBackedIpo','TR.IPODate','IPO_PRC','TR.FilssuerName','TR.FilssuerFitchLongRating Those are already the right codes from refinitiv for the accounting measures and other information I want to extract. However, for the company market cap, net profit, EBITDA, Net Debt, EV, EPS, ROA I am getting the data for 12 years in a row starting from the IPO date.

For this measure, I want to get the data for two defined dates in the past. Please send me the python EIKON API code for extracting the information for these variables for two from me defined dates. The first date will be the variable “IPO Date” which is already defined by me, the second date is IPO Date + 3 years. It should be the formula underneath for extracting. I only face the problem how to add the parameters for receiving data for two time points that I define by myself for the measures instead of getting the data for 12 years. Also, I am getting not always getting the date information which I would wish to extract too. For getting the date I use: 'TR.NetProfitMean.PeriodEndDate', 'TR.PE.Date': Is there a better option for retrieving the data information?


Here are the important lines of my code:

stockData, e = ek.get_data(rics[i], fields = accounting, parameters = {'SDate': start[i], 'EDate': 2, 'FRQ':'Y', 'Curn': 'USD'})
accounting = ['TR.CompanyMarketCap',
'TR.NetProfitMean.PeriodEndDate',
'TR.PE.Date',
'TR.NetProfitMean',
'TR.EBITDAMean',
'TR.NetDebtMean',
'TR.EVMean',
'TR.RepEPSMean',
'TR.CompanyMarketCapitalization',
'TR.TotalAssetsMean',
'TR.ROAMean']

eikoneikon-data-apipython api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
86k 292 53 78

@novasbe29

The values of the SDate and EDate parameters could be either relative or absolute dates.

1636009611298.png

You can use the following method to calculate EDate (IPO Date + 3 years).

sdate = "2000-11-11"
edate = str(int(sdate.split('-')[0])+3)+"-"+sdate.split('-')[1]+"-"+sdate.split('-')[2]

To get a formula, you to contact the Eikon support team directly via MyRefinitiv. You can ask for the =TR formula in Eikon Excel which can be used to retrieve the required data. If the formula is available, we can apply it to the get_data method in Eikon Data API. That way a content specialist can work closely with you to find a way to get the required data.


1636009611298.png (64.2 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.