Question related to Workspace Python API - for case 14761377

kerrong.tan
edited May 13 in Eikon Data APIs

I would like to pull financial statement for a specific RIC

Here's the Python Api code I'm using

In the parameters line, I use reporting State = Rsdt (restated I believe). However, even if I change it to "Orig", the data seems to be the same and did not change accordingly.

Is there any way I can get all the accounting items name and value for Original/As reported by the company?

import pandas as pd

import numpy as np

from datetime import datetime

import eikon as ek

ek.set_app_key('<key>')

income_statement, err =ek.get_data(['NVDA.O'],['TR.F.IncomeStatement.fieldname','TR.F.IncomeStatement.fielddescription', 'TR.F.IncomeStatement.fperiod','TR.F.IncomeStatement.date', 'TR.F.IncomeStatement'],

parameters = {'Period':'FQ0', 'Frq' : 'FQ', 'SDate' : 0, 'EDate': -4,

'reportingState':'Rsdt', 'curn':'Native', 'Scale':'6', #'SORTA':'date'

}

)

income_statement['Date'] = income_statement['Date'].apply(lambda x: datetime.strptime(x, '%Y-%m-%dT%H:%M:%SZ'))

income_statement = income_statement.rename(columns = {'Date': 'Period End Date'})

income_statement

Tagged:

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @kerrong.tan

    Thank you for reaching out to us.

    I tested it on the Workspace Excel. Both Rsdt and Orig return the same values.

    Please contact the helpdesk team directly via MyAccount to verify the data.

  • kerrong.tan
    edited May 15

    Hi @Jirapongse , thank you for your reply. Internal had replied as below, could you advise on the follow up query?

    Follow up query:

    I understand the issue here about Reportinstate=Orig or Rsdt. I have another question though. The code seems to return a standardized set of accounting item for most firms. However, each company reported different sets of accounting items in their quarterly filings. I am wondering is there a programmatic way to get the "as reported" statement of different RIC? Thank you.

    Here is the reply from internal team:

    "Reportingstate=rsdt is the most recent period and Reportingstate=Orig is the initial update for that period. For any company if there is no restatement or reclassification then original document will itself will be represented as most recent period. Hence when you request for rsdt you can see both Original and restatement periods. Hope this clarifies."

    "For each period Content generates 2 series of data original to original - Orig (first financials reported by the company) recent to recent - Rsdt (most recent financials for the same period)

    Recent to recent will have different financials when there is a change in value when compared to original statement otherwise same original data will be carried out to Recent to recent as well.

    So, there is no issue if Original is reflecting under both Original to original (Reportinstate=Orig) and Recent to Recent (Reportingstate = Rsdt). This means company has not reported any changes to the original data. This is completely fine."

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @kerrong.tan

    The functionalities in the API is quite similar to the =RDP.Data in Excel.

    It requires RICs, fields, and parameters.

    Please check with the content team if there are RICs, fields, and parameters in Excel that can provide the required data. Then, I can convert the excel formula to Python code.

  • Hi @Jirapongse, the RICs, fields, and parameters were mentioned in the initial query:

    RIC: <NVDA.O>

    Fields:

    TR.F.IncomeStatement.fieldname

    TR.F.IncomeStatement.fielddescription

    TR.F.IncomeStatement.fperiod

    TR.F.IncomeStatement.date

    TR.F.IncomeStatement

    Parameters = {'Period':'FQ0', 'Frq' : 'FQ', 'SDate' : 0, 'EDate': -4,'reportingState':'Rsdt', 'curn':'Native', 'Scale':'6', #'SORTA':'date'

    Could you assist to review this and convert the excel formula to Python code?

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    The client is using it.

    income_statement, err =ek.get_data(['NVDA.O'],['TR.F.IncomeStatement.fieldname','TR.F.IncomeStatement.fielddescription', 'TR.F.IncomeStatement.fperiod','TR.F.IncomeStatement.date', 'TR.F.IncomeStatement'],

    parameters = {'Period':'FQ0', 'Frq' : 'FQ', 'SDate' : 0, 'EDate': -4,

    'reportingState':'Rsdt', 'curn':'Native', 'Scale':'6', #'SORTA':'date'

    }

    )

  • Alright, may I have your advice how can we solve this based on the follow up query since client actually is using the Phyton code.

    Follow up query:

    I understand the issue here about Reportinstate=Orig or Rsdt. I have another question though. The code seems to return a standardized set of accounting item for most firms. However, each company reported different sets of accounting items in their quarterly filings. I am wondering is there a programmatic way to get the "as reported" statement of different RIC? Thank you.

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @kerrong.tan

    It is better to clarify the question. For example: What is the "as reported" statement of different RIC?

    The output of that code is:

    image.png

    If the client would like to get the same data for other RICs, the client can add more RICs in the first parameter. For example:

    income_statement, err = ek.get_data(
        ['NVDA.O','IBM.N'],
        ['TR.F.IncomeStatement.fieldname',
         'TR.F.IncomeStatement.fielddescription', 
         'TR.F.IncomeStatement.fperiod',
         'TR.F.IncomeStatement.date', 
         'TR.F.IncomeStatement'],
        parameters = {
            'Period':'FQ0', 
            'Frq' : 'FQ', 
            'SDate' : 0, 
            'EDate': -4,          
            'reportingState':'Rsdt', 
            'curn':'Native', 
            'Scale':'6'})
    income_statement
    

    However, this forum is dedicated to technical queries on LSEG product APIs.

    The moderators on this forum do not have deep expertise in every bit of content available through LSEG products, which is required to answer content questions such as this one. The best resource for content questions is the Helpdesk support team, which can be reached by submitting queries through MyAccount.

    The support team will either have the required content expertise ready available or can reach out to relevant content experts to get the answer for you.