Is there a way to get full historical data of an instrument using RDP Python API?

Below is my code to retrieve an example bond data using RDP Python API:


import refinitiv.data as rd

from refinitiv.data.content import historical_pricing

rd.open_session('desktop.workspace')

response = historical_pricing.summaries.Definition(

universe='TH179175215=',

fields=['ZSPREAD'],

start='2010-04-20',

end='2024-06-03',

).get_data()

response.data.df

Currently, I am arbitrarily defining an early date (2010-04-20) to get the full history of the bond data. However, I would like to ask if there is a value I can put for the start parameter to get the full historical data? Something like 'BDATE' in the Datastream Python API. Thanks!

Best Answer

  • Jirapongse
    Answer ✓

    @feldman.lee

    Thank you for reaching out to us.

    You may use another function to get the date. For example, I found that the TH179175215= provide the TR.FirstAnnounceDate field.

    rd.get_data(["TH179175215="],["TR.FirstAnnounceDate"])

    The output is:

    1718600484753.png

    You can use the Data Item Browswer tool to search for other fields. However, you can contact the helpdesk support team my Refinitiv to confirm that this is the corrrect date field.

    Otherwise, if you don't specify the start parameter, it will return the EarliestAvailable but you need to specify the count parameter.

    response = historical_pricing.summaries.Definition(
    universe='TH179175215=',
    fields=['ZSPREAD'],
    end='2024-06-03',
    count=10000
    ).get_data()


    response.data.df