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

  • 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

  • The car sharing market is a rapidly growing industry in the global economy. So from this link you'll learn how to create a Turo clone: https://merehead.com/blog/how-to-build-a-p2p-car-rental-app-like-turo/

  • Hi @Mikee_R,

    You can also still use `get_data` in RD:

    df2 = rd.get_data(
        ["AAPL.O", "MSFT.O"],
        fields=["TR.F.IncomeStatement",
                "TR.F.IncomeStatement.date",
                "TR.F.CashFlowStatement",
                "TR.F.IncomeStatement(Scale=6)"])
    df_dict = {}
    for i in df2.Instrument.unique():
        df_dict[i] = [df2[df2.Instrument == i]]
    for i in df_dict:
        display(i)
        display(df_dict[i][0])


    1690803061720.png

    You may be interested in using MultiIndex too.

  • Hi @Mikee_R ,

    FYI, if you would like individual elements of the Income Statement (or other such fundamental items), you can find them with each of their field names on the DIB:

    1690803703376.png