API for Eikon vs Workspace Data

Jayson
Jayson LSEG
edited March 26 in Eikon Data APIs

Client is currently testing the API for Eikon vs Workspace and the output are different for some fields related to Deals. Attached is a screenshot for your reference. Can you please check if this is normal and what is the reason behind this? Do we have the correct way of getting the data? (Attached screenshot from API)

API Screenshot.png

I checked in Screener and the data seems to be matching. (Attaching screenshot from Screener.)

Screener Screenshot.png

Answers

  • Hello @Jayson

    Could you please ask the client for the source code that they are using on Eikon and Workspace?

  • Jayson
    Jayson LSEG
    edited March 26

    Hello @wasin.w

    Thank you for checking this. Attached the python notebook provided by the client.

  • Hello @Jayson

    The attachment includes the client service information and credential. This is a public forum, so please do not share the client information again.

    I have removed the client's service information and credential from the attachment.

  • Hello @Jayson

    Thank you for the information. I checked the given source code. The client's code queries the fields from internal database, so I cannot test the completed fields set the same as client.

    Please confirm if my replication results (see below) are the same as the client, then I will contact the library team to check this issue.

    I am testing with https://developers.lseg.com/en/api-catalog/eikon/eikon-data-api and Data Library version 1 (RD)/Data Library version 2 (LD) using the following query and field:

    query_string1 = (
    'SCREEN('
    'U(IN(DEALS)), ' # Base filter for deals
    'IN(TR.MnAStatus,"P","C"), ' # MnA Status filter: Pending or Completed
    'IN(TR.MnAType,"1"), ' # MnA Type filter: Specific type: Disclosed Value
    'IN(TR.MnATargetNation,"US") OR IN(TR.MnAAcquirorNation,"US"), ' # Nation filter: Target or Acquiror is US
    'BETWEEN(TR.MnAAnnDate,20100101,20241128), ' # Date range filter: 2010-01-01 to 2024-11-22
    'TR.MnARankValueIncNetDebt(Scale=9)>=1, ' # Rank value filter: >= 1 (scaled to billions)
    'NOT_IN(TR.MnAREITType,"EQ","HY","MO","UN"), ' # REIT Type exclusion: Exclude specific REIT types
    'TR.MnAHasDisclosedFee==true, ' # Disclosed fee filter: Include only deals with disclosed fees
    'NOT_IN(TR.MnATargetFinAdvisorLong,"5422M","33722M","48279M","49326M","50255M","53043M","53456M","61457M") AND '
    'NOT_IN(TR.MnAAcquirorFinAdvisorLong,"5422M","33722M","48279M","49326M","50255M","53043M","53456M","61457M")' # Exclude PJT
    ')'
    )
    fields = ['TR.MNARATIOOFENTERPRISEVALUEATEFFDATETOEBIT']

    Eikon Data API:

    import eikon as ek

    ek.set_app_key('My App Key')

    deal_ek, err = ek.get_data(
    instruments = query_string1,
    fields = fields,
    parameters = {"Curn": "USD"},
    field_name=True
    )

    deal_ek.head()

    deal_ek.dtypes
    ek_1.png ek_2.png

    Data Library version 1:

    import refinitiv.data as rd

    rd.open_session()

    deal_rd = rd.get_data(
    universe=query_string1,
    fields=fields,
    parameters={"Curn": "USD"},
    use_field_names_in_headers=True
    )

    deal_rd.head()

    deal_rd.dtypes
    rd_1.png rd_2.png

    Note: Data Library version 2 (LD) returns the same result as version 1

  • Hello @wasin.w

    Good day!

    As per client, The problematic code is "TR.mnaratioofenterprisevalueateffdatetoebit".

    The question is why the Eikon Data API and WS API returns different data types. To be very specific, for the code mnaratioofenterprisevalueateffdatetoebit:

    • Eikon API returns a float (correct)
    • WD API returns a time stamp (incorrect)

    May you please check and advise?

    Thank you so much for your continued assistance on this.

    Regards,

    Jayson

  • Hello @wasin.w

    Client provided further details. Please refer below:

    "I have attached a list of different fields and deal number that shows different output between EK vs RD."

    image (68).png

    "This is the code I'm using. If you compare the result of using RD and EK for the fields shown in the attached file, the results are different, especially for 'mnaratioofenterprisevalueateffdatetoebit'."

    (Notepad File attached)

    image.png
  • Hello @Jayson

    The library team confirms the format is applied by the library. If the data retrieved from UDF do not include the field metadata, the type is identified based on the field name and the field label.

    An application can use this code before calling rd.get_data() or ld.get_data() method to avoid the issue.

    rd.session.get_default().config.set_param("apis.data.datagrid.underlying-platform", "rdp")
    

    Or (in case of https://developers.lseg.com/en/api-catalog/lseg-data-platform/lseg-data-library-for-python )

    ld.session.get_default().config.set_param("apis.data.datagrid.underlying-platform", "rdp")
    

    I did a quick test. It works fine on both RD and LD Libraries.

    rd_fix.png ld_fix.png
  • Jayson
    Jayson LSEG
    edited April 1

    Hello @wasin.w

    Thank you for all your help on this. The client has another follow-up. Please refer below:

    I still have some issues with the code. Here is the code I am using and the output:

    (Attached file with the client's codes. File name: Follow-up 1)

    Please advise on why the timeout occurs when I have added multiple fields. This was not the problem before I added the line:

    rd.session.get_default().config.set_param("apis.data.datagrid.underlying-platform","rdp")

    Please have a look and assist.

    Thank you and have a great day!

    Regards,

    Jayson

  • Hello @Jayson

    Can you suggest the client to increase the HTTP request timeout to more than 60 (seconds)? Please check my colleague answer on this old post to see how to change the value on the refinitiv-data.config.json file :

  • Hello @wasin.w

    Greatly ppreciate all your help on this. The client has another follow-up:

    “This issue has not happened before. May I know what might have contributed to the timeout issue? Has there been any updates to the API?”

    May you please have a look and check? Thank you so much!

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    I think that code changes the endpoint used to retrieve data.

    That code change the endpoint to http://localhost:9001/api/rdp/data/datagrid/beta1/.

    This endpoint may take more time to extract data. However, we can't access the endpoint log to verify what the problem is. Please contact the helpdesk team to verify it.

  • Hello @Jayson

    I have contacted the Data Library team. The team says that rd.session.get_default().config.set_param("apis.data.datagrid.underlying-platform","rdp") statement changes underlying platform to get the data in the right format which takes times + requesting SCREEN() is also a time consuming, so the timeout can be occurred.

    The team suggests the client increases HTTP request timeout to avoid the issue.