For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
27 2 1 5

Retrieve historic PAR_YLD and SWAP_SPRD through Eikon Python Data API

We want to retrieve the same data as the below Excel functions do, but through the Eikon Python API.

RHistory("AEURNFI5Y=";"PAR_YLD.Timestamp;PAR_YLD.Close";"START:"&START_DATE_ANALYSIS&" END:"&Value_Date&" INTERVAL:1D";;"NULL:NA TSREPEAT:NO CH:Fd";B12)

RHistory("AEURNFI5Y=";"SWAP_SPRD.Timestamp;SWAP_SPRD.Value";"START:"&START_DATE_ANALYSIS&" END:"&Value_Date&" INTERVAL:1D";;"NULL:NA TSREPEAT:NO CH:Fd";E12)

Using get_timeseries does not seem to work, as it does not accept PAR_YLD or SWAP_SPRD.

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonhistorical
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
3.8k 4 4 6

Hi @tr105

The Swap Spread is available under TR.SWAPSPREAD field:

ek.get_data('AEURNFI5Y=',['TR.SWAPSPREAD.date','TR.SWAPSPREAD'],parameters={'SDate':'-30D','EDate':'0D'})

However PAR_YIELD is not mapped to any TR.xxx field but you can use get_timeseries method where that data resides under CLOSE field.

ek.get_timeseries('AEURNFI5Y=','CLOSE',start_date='2019-09-01', end_date='2019-09-16')
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
27 2 1 5

Thanks for your answer! I suspected this, but thanks a lot for confirming.

Is this documented somewhere? I.e. how the field names from the Excel API map to the Python API / Data Item Browser.


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Hi @tr105
All TR.xxx fields should be accessible both through Excel and API therefore no mapping is required. The tricky part could be with the fields that you retrieve using RHiistory() function as this is taken from another source and you cannot implement the exact field names. I think that this is a matter of time when all data items will be available using the first method. For a now you need to do a trial and error to make sure which field gives you the expected result.
Click below to post an Idea Post Idea