Eikon API guidance summary data gets mixed up

Francisco
Francisco Newcomer
edited May 19 in Eikon Data APIs

Hello,

I am trying to pull guidance summary data using eikon api.

My issue is that when I include new data field (for example TR.GuidanceUnitType),

the data gets mixed up and some items like revenues show up as tax rates.

I have seen this happen as I include and exclude different data fields.

Please let me know why this is happening.

I have included the screenshots for your reference.

As you can see, some of the guidance items showing up as tax rates are actually not tax rates, but some other measures.

Thank you very much.

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @Francisco

    Thank you for reaching out to us.

    The Eikon Data API wasn't updated since 2023.

    Please try the new LSEG Data Library for Python instead. I tested it and the data looks correct.

    df = ld.get_data(
            universe=['MSFT.O'],
            fields = ['TR.GuidanceDate',
                      'TR.GuidancePeriodYear',
                      'TR.GuidancePeriodMonth',
                      'TR.GuidanceLowValue',
                      'TR.GuidanceHighValue',
                      'TR.GuidanceUnitType',
                      'TR.GuidanceMeasure',
                      'TR.GuidanceSegmentName',
                      'TR.GuidanceDocType',
                      'TR.GuidanceSpeaker',
                      'TR.GuidanceAcctType',
                      'TR.GuidanceDataForm',
                      'TR.GuidanceText'],
            parameters = {
                'Period':'FQ1',
                'Frq':'FQ',
                'SDate':'2020-01-01',
                'EDate':'2025-07-30',
                'GuidAcctType':'ALL',
                'Scale':6
            }
    )
    df
    

    The examples are available on GitHub.

  • Francisco
    Francisco Newcomer

    Hello Jirapongse,

    Thank you very much for your help.

    Is the new data library relatively easy to learn?

    I also had a few additional questions.

    1. If I would like to get both quarterly and annual guidance (given every quarter), how should I modify the parameters?
    2. How do I found out the data range available for each firm? For example, when does the earliest guidance data start for Microsoft?
    3. If I would like to fully understand what fields are available for each parameter, which documentation should I take a look? Could you give me some resources that can help me understand the syntax?

    I really appreciate your help.

  • Francisco
    Francisco Newcomer

    Hello Jirapongse,

    Thank you very much for your help.

    Is the new data library relatively easy to learn?

    I also had a few additional questions.

    1. If I would like to get both quarterly and annual guidance (given every quarter), how should I modify the parameters?
    2. How do I found out the data range available for each firm? For example, when does the earliest guidance data start for Microsoft?
    3. If I would like to fully understand what fields are available for each parameter, which documentation should I take a look? Could you give me some resources that can help me understand the syntax?

    I really appreciate your help.

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @Francisco

    Yes, it is easy to learn. There are a lot of examples available on GitHub.

    The code can be changed to:

    import lseg.data as ld
    ld.open_session(app_key = 'APP_KEY')
    
    df = ld.get_data(…)
    

    You can use the Data Item Browser tool to list all available fields and parameters.

    image.png

    However, this forum is dedicated to software developers using LSEG 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.

  • Francisco
    Francisco Newcomer

    Hello,

    Thank you very much for your help.

    I tried using the new library, but I still have the same issue.

    Screenshot 2025-05-19 161112.png Screenshot 2025-05-19 161137.png

    Could you please take a look at my screen shots and let me know what the problem is?

    I also do not understand the warning regarding 'downcasting'

    I would appreciate if you explain what the warning is trying to say.

    Thank you very much.

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @Francisco

    Please try this one:

    df = ld.get_data(
            universe=['MSFT.O'],
            fields = ['TR.GuidanceDate(GuidAcctType="ALL")',
                      'TR.GuidancePeriodYear(GuidAcctType="ALL")',
                      'TR.GuidancePeriodMonth(GuidAcctType="ALL")',
                      'TR.GuidanceLowValue(GuidAcctType="ALL")',
                      'TR.GuidanceHighValue(GuidAcctType="ALL")',
                      'TR.GuidanceUnitType(GuidAcctType="ALL")',
                      'TR.GuidanceMeasure(GuidAcctType="ALL")',
                      'TR.GuidanceSegmentName(GuidAcctType="ALL")',
                      'TR.GuidanceDocType(GuidAcctType="ALL")',
                      'TR.GuidanceSpeaker(GuidAcctType="ALL")',
                      'TR.GuidanceAcctType(GuidAcctType="ALL")',                 
                      'TR.GuidanceText(GuidAcctType="ALL")'],
            parameters = {
                'Period':'FQ1',
                'Frq':'FQ',
                'SDate':'2020-01-01',
                'EDate':'2025-07-30',
                'Scale':6
            }
    )
    

    The warning indicates the the library uses the deprecated pandas method (replace) which will be removed in a pandas future version. The product team is aware of this warning.

    C:\Python312\Lib\site-packages\lseg\data\_tools\_dataframe.py:192:FutureWarning: Downcasting behavior in `replace` is deprecated and will be removed in a future version. To retain the old behavior, explicitly call `result.infer_objects(copy=False)`. To opt-in to the future behavior, set `pd.set_option('future.no_silent_downcasting', True)`
    

    Currently, you can ignore this warning by using the following code.

    import pandas as pd
    pd.set_option('future.no_silent_downcasting', True)
    
  • Francisco
    Francisco Newcomer

    Hello,

    Thank you very much for your help.

    I figured out that drop.na and drop.duplicates are causing the problem.

    Do you know why this might be the case?

    As long as I do not include them in my code, the data is stable and accurate.

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @Francisco

    I rechecked it and found that the issue happens randomly.

    image.png

    I can replicate this issue on the Workspace Excel with the following formula.

    =@RDP.Data("MSFT.O","TR.GuidanceDate;TR.GuidancePeriodYear;TR.GuidancePeriodMonth;TR.GuidanceLowValue;TR.GuidanceHighValue;TR.GuidanceUnitType;TR.GuidanceMeasure;TR.GuidanceSegmentName;TR.GuidanceDocType;TR.GuidanceSpeaker;TR.GuidanceAcctType;TR.Guida"&"nceDataForm;TR.GuidanceText","Period=FQ1 Frq=FQ SDate=2020-01-01 EDate=2025-07-30 CH=Fd RH=IN GuidAcctType=ALL Scale=6",B2)
    
    image.png

    Because the problem also happens on the Workspace Excel, please contact the helpdesk team via MyAccount to investigate this issue.

  • Francisco
    Francisco Newcomer

    Hello Jirapongse,

    I have reached out to the help desk team and got a response.

    Screenshot 2025-05-21 152248.png

    They basically told me to post this here and have the excel formula replicated in python code.

    Unfortunately, I am not very proficient with the excel formula. Could you help me with the python code of it?

    Thank you very much and I appreciate it.

    The below excel formula is sorted by Guidance Measure to arrange Tax Rate, Revenue, etc in order:

    =@RDP.Data("MSFT.O","TR.GuidanceDate(GuidAcctType=ALL);TR.GuidancePeriodYear(GuidAcctType=ALL);TR.GuidancePeriodMonth(GuidAcctType=ALL);TR.GuidanceLowValue(GuidAcctType=ALL

    Scale=6);TR.GuidanceHighValue(GuidAcctType=ALL Scale=6);TR.GuidanceUnitType(Gu"&"idAcctType=ALL);TR.GuidanceMeasure(GuidAcctType=ALL);TR.GuidanceSegmentName(GuidAcctType=ALL);TR.GuidanceDocType(GuidAcctType=ALL);TR.GuidanceSpeaker(GuidAcctType=ALL);TR.GuidanceAcctType(GuidAcctType=ALL);TR.GuidanceDataForm(GuidAcctType=ALL);TR.Gui"&"danceText(GuidAcctType=ALL)","Period=FQ1 Frq=FQ SDate=2020-01-01 EDate=2025-07-30 CH=Fd RH=IN SORTA=TR.GuidanceMeasure",B2)

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @Francisco

    I have contacted the helpdesk to refresh the formula several times to replicate the issue.

    image.png

    You may ask them for the same.

  • Francisco
    Francisco Newcomer

    Hello Jirapongse,

    Shall I just stay put until this issue is solved? Could you please let me know once there is no issue pulling the data with the original python code?

    In addition to this, is there a python code that can pull quarterly and annual guidance simultaneously? How will I have to modify the parameters to do this?

    Thank you very much.

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @Francisco

    The problem must be solved at the server side, not Python.

    Please contact the support team on the case#14796016 to investigate this issue.

    Python and Excel retrieve data from the same data source. I think if the issue on Excel has been solved, the issue on Python will be solved too.

    The Period and Frq parameters accept one value at a time. Therefore, as far as I know, it can't be used to pull quarterly and annual guidance in the same request. However, you need to contact the helpdesk team to confirm it.

    'Period':'FQ1',
    'Frq':'FQ',