Retrieve PAR_AMT field from Refinitiv Eikon API via Phyton

Dear support, I'm trying to recover the PAR_AMT field from Refinitiv Eikon API using Phyton as language. I could recover any record by using the instrument ISIN code as input. Thus, as suggested by Refinitiv support, I try to retrieve the RIC Code to be used as input to query the PAR_AMT field, but the result is the following:

1698134260824.png


I have access to the field, as confirmed by Refinitiv support. Below you can find an example of the code I'm using to recover the RIC Code:


# ======== First Demo Script ========


import eikon as ek

import refinitiv.dataplatform as rdp

from rich import print

from refinitiv.dataplatform.factory.content_factory import ContentFactory


rdp.open_platform_session(

app_key='***',

grant=rdp.GrantPassword(

'***',

'***'

)

)



df = rdp.get_data(

universe=['EU000A3JZR92', 'BE0312794663', 'ARARGE03E113'],

fields=['TR.PreferredRIC']#, 'TR.HeadquartersCountry']

)



#print(df)

#print(ContentFactory._last_result)


response: rdp.content.data_grid._response.FundamentalResponse = ContentFactory._last_result

print('\n\n',response.data.raw,'\n\n')


"""

RESULT

{'error': {'code': 221, 'description': 'The access to field(s) denied.', 'content': ...}}

"""


# ======== Second Demo Script ========

import eikon as ek


ek.set_app_key('***')


isin = ['EU000A3JZR92', 'BE0312794663', 'ARARGE03E113']



data, error = ek.get_data(isin, ['TR.PreferredRIC'])

print(

'data: ', data,

'\n\n\nerror: ', error

)


"""

RESULT

Failed to decode response to json: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><title>Sign In</title><...

*****************************


Could you help me further please?


Thanks,


Sergio

Best Answer

  • aramyan.h
    Answer ✓

    Hi @s.bariatti ,


    I believe, to convert ISIN to RIC you need to use symbology conversion functions. I would suggest using our latest Refinitiv Data Libraries for Python for such queries. Below is an example of such conversion:

    response = symbol_conversion.Definition( ['EU000A3JZR92', 'BE0312794663', 'ARARGE03E113']).get_data()
    response.data.df

    screenshot-2023-10-24-at-093821.png

    You can also specify some conversion parameters like below:

    response = symbol_conversion.Definition(
    symbols=['EU000A3JZR92', 'BE0312794663', 'ARARGE03E113'],
    from_symbol_type=symbol_conversion.SymbolTypes.ISIN,
    to_symbol_types=[
    symbol_conversion.SymbolTypes.RIC,
    symbol_conversion.SymbolTypes.OA_PERM_ID
    ],
    ).get_data()

    response.data.df

    Finally yoy can use rd.get_data function to get PAR_AMT:

    rd.get_data(['XS268996907=', 'BE79466=', 'ARDICA='], fields = 'PAR_AMT')

    screenshot-2023-10-24-at-094110.png

    Hope this helps.


    Best regards,

    Haykaz

Answers

  • Thanks for the answer.

    I'm currently not using the python package Refinitive but instead I'm using the python package Eikon, could you share an example with Eikon?


    Also, could you confirm that by using Eikon or Refinitive or directly using the API via the 'Requests' package there are no differences in terms of product availability?

  • Hi @s.bariatti ,


    This is the equivalent code for Eikon

    ek.get_symbology(
    ['EU000A3JZR92', 'BE0312794663', 'ARARGE03E113'],
    # from_symbol_type='ISIN',
    # to_symbol_type='RIC'
    )

    However it didn't return RIC for your instruments, that is why I suggested using RD libraries. Please try with RD and let me know if any issues. You should have access to that as well. In the meantime I will raise a content query to our helpdesk on behalf of you re the Eikon


    Best regards,

    Haykaz

  • As for the using Library versus the endpoints, there should't be any availability differences as much as I know
  • Hello,

    I tried and use the following script to retrieve PAR_AMT using Refinitiv API:

    rd.get_data(['XS268996907=', 'BE79466=', 'ARDICA='], fields = 'PAR_AMT')


    Result is the following error message:


    "No user scope for key=/streaming/pricing/v1/, method=GET.

    Insufficient Scope. Cannot load the list of associated URLs from https://api.refinitiv.com/streaming/pricing/v1/ for apis.streaming.pricing.endpoints.main endpoint.

    refinitiv.data._errors.RDError: Error code -1 | Error code -1 | Insufficient scope for key=/streaming/pricing/v1/, method=GET.

    Required scopes: {'trapi.streaming.pricing.read'}

    Available scopes: {'trapi.graphql.subscriber.access', 'trapi.user-framework.workspace.crud', 'trapi.data.historical-pricing.summaries.read', 'trapi.auth.cloud-credentials', 'trapi.streaming.prcperf.read', 'trapi.messenger', 'trapi.data.get.data.read', 'trapi.synthetic.crud', 'trapi.user-framework.mobile.crud', 'trapi.alerts.history.crud', 'trapi.frtb.sentimarization', 'trapi.searchcore.lookup.read', 'trapi.search.read', 'trapi.alerts.subscription.crud', 'trapi.alerts.preferences.crud', 'trapi.searchcore.read', 'trapi.search.metadata.read', 'trapi.data.quantitative-analytics.read', 'trapi.search.lookup.read', 'trapi.data.average-volume-analytics.ava_read', 'trapi.user-framework.recently-used.crud', 'trapi.sdbold', 'trapi.alerts.publication.crud', 'trapi.data.historical-pricing.events.read', 'trapi.searchcore.metadata.read', 'trapi.streaming.synthetic.read', 'trapi.search.explore.read', 'trapi.data.benchmark.bmk_read', 'trapi.user-framework.application-metadata.raplib'}

    Missing scopes: {'trapi.streaming.pricing.read'}"

    Can you look into it please?