TR.F.IncomeStatement

Hi forum,

I'm using the Refinitiv API for Python to retrieve ESG data and company fundamentals from Refinitiv. In order not to manually select all financials one by one I intended to use "TR.F.IncomeStatement", "TR.F.CashFlowStatement", and "TR.F.BalanceSheet" to retrieve relevant financials from the companies I have selected.

Unfortunately, when retrieving the data, the API does not display the financials as columns, but as rows. Furthermore, it labels each financial KPI not with the respective name (i.e. Revenue) but with the instrument name to which the financial KPI belongs (see screenshot).
I would be interested to modify the ek.get_data formula in a way that it displays the financial KPIs in columns, however, I could not find anything in the documentation.
For reference, the snippet in "parameters" is the part of the excel formula that the Eikon API provided in order to put the table in the desired dimension.
1690561522198.png

Best Answer

  • [Deleted User]
    [Deleted User] Newcomer
    Answer ✓

    Hi @Mikee_R ,


    I would advise using the updates library, RD. You can find more information about the difference between RD and EDAPI in our article here.
    Using the RD lib., I managed to get date in another format. Is that what you were after?


    import refinitiv.data as rd
    rd.open_session()
    df1= rd.get_history(
        universe=["AAPL.O", "MSFT.O"],
        fields=["TR.F.IncomeStatement",
                "TR.F.CashFlowStatement",
                "TR.F.IncomeStatement(Scale=6)"],
        # interval="1Y",
        # start="2010-01-01",
        # end="2023-07-01"
        )
    df1


    1690802095944.png


    .

Answers