question

Upvotes
Accepted
1 1 1 1

Unable to get some fields in Refintiv Data Library (refinitiv.data) - Python

I know there is a migration plan from Refinitiv Eikon to Refinitiv Workspace.

1) May I know will Eikon API proxy will be demised for this migration plan?

2) As I am trying to enhance the coding by using Refinitiv Data Plaform Library instead of Eikon. Can you please advise on how to get below fields when using Workspace API? It seem the fields are only works for data extraction when using Eikon API. Thanks!

Eikon API:

split_rq3 = ek.get_data(

instruments = ['CODE.BO'],

fields = [

'OFF_CLOSE',

'HST_CLOSE',

'OFF_CLS_DT',

'CF_DATE',

'CF_LAST',

'CURRENCY',

],

parameters = {

'CH' : 'Fd',

'SDate' : '2019-09-26',

'EDate' : '2019-09-26'

}

)


Workspace API:

split_rq3 = rd.get_data(

universe = ['CODE.BO'],

fields = [

XXXXXXXX

],

parameters = {

'CH' : 'Fd',

'SDate' :'2019-09-26',

'EDate' : '2019-09-26'

}

)


1673267099525.png


eikonpythonworkspace#technology#contentrefinitiv-data-platformpython apicodebook
1673267099525.png (34.5 KiB)
icon clock
10 |1500

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

Upvotes
Accepted
10.3k 18 6 9

@rita.leung Hi - thanks for your questions - the following works for me:

1) In terms of the migration - the proxy will remain in Workspace - only the much older Eikon COM APIs are not available with Workspace.

The Refinitiv Data (RD) Library also contains the Eikon Data API library as an extension for backwards compatibility - though we recommend using the RD library as it has a number of benefits and new features.

2) The following code works for me:

import refinitiv.data as rd
rd.open_session('YOUR APP KEY HERE')
split_rq3 = rd.get_data(universe = ['CODE.BO'],fields =['OFF_CLOSE','HST_CLOSE','OFF_CLS_DT','CF_DATE','CF_LAST','CURRENCY'],parameters = {'CH' : 'Fd','SDate' :'2019-09-26','EDate' : '2019-09-26'})

split_rq3

1673273417273.png

I hope this can help.


1673273417273.png (29.7 KiB)
icon clock
10 |1500

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

Upvotes
1 1 1 1

Hi @jason.ramchandani01, thanks for your reply.

I have tried the same code (with login Refinitiv Workspace), but it seems not works for me.

1673277390347.png

Once I changed the fields to TR.XXX, it can extract the values. Do you know the root cause and how to solve it?

1673277481410.png



1673277390347.png (57.8 KiB)
1673277481410.png (18.7 KiB)
icon clock
10 |1500

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

Upvotes
22.7k 59 14 21

Hi @rita.leung,

The code works in the Workspace as well - maybe you don't have permission to view the real time data for this exchange.

1673298364914.png


1673298364914.png (28.6 KiB)
icon clock
10 |1500

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

Upvotes
22.7k 59 14 21

Also please note that these are real-time fields, which do not offer history feature. The parameters Sdate and Edate do not apply to them. See the Data Item Browser for fields which support time series.

1673298601607.png


1673298650617.png (22.2 KiB)
icon clock
10 |1500

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

Upvotes
10.3k 18 6 9

@rita.leung you would use the get_data to get the latest snapshot data for those fields and instruments - if you wanted to get a history you can just check the full historical pricing data model for an instrument - this will tell you what historical realtime fields are captured (they do vary by instrument class). This is very simple to do with the RD Library:

rd.get_history("CODE.BO")

1673343813887.png

Once you have seen all fields, you can narrow down the selection to which fields you want very easily and for what interval and periods:

rd.get_history(universe="CODE.BO", fields=['OFF_CLOSE','LST_TRD_PR'], interval="1D", start="2022-01-01", end="2022-10-01")

1673344455751.png

You will not get all the reference or fundamental fields - eg TR.PriceMoPriceCurrency or TR.CommonName, TR.RevenueMean - from the get_history call as it uses the historical pricing data model only. If you need any such non-realtime fields just make a get_data request either snapshot or with history. For realtime fields such as CF_NAME or CURRENCY just make a get_data snapshot call.

I hope this can help.


1673343813887.png (141.2 KiB)
1673344455751.png (82.1 KiB)
icon clock
10 |1500

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

Upvotes
1 1 1 1

Hi, @jason.ramchandani01 & Gurpreet. Thank you for all your assistance.

For the get_history call, is it available to do the extraction with latest trading day only? It seem the function is required starting from yesterday and end with today.

icon clock
10 |1500

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

Upvotes
10.3k 18 6 9

@rita.leung No for the last value ie for today you can use a get_data - which can give you latest values. I hope this can help.

icon clock
10 |1500

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

Upvotes
1 1 1 1

For the extraction of these fields ('OFF_CLOSE','HST_CLOSE','OFF_CLS_DT','CF_DATE','CF_LAST','CURRENCY'), I have used my Delayed account to extract the values by using Eikon API proxy (ek.get_data), which works for the extraction.

However, it can not extraction the result by using Workspace API (rd.get_data). Is it a limitation with Workspace API for this permissions/entitlements?

icon clock
10 |1500

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

Hi @rita.leung

Try with providing the delayed RIC directly

rd.get_data(['/CODE.BO'])
Upvotes
1 1 1 1

Hi, @jason.ramchandani01 & Gurpreet. Any comment on above question? Thanks a lot!

icon clock
10 |1500

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

Upvotes
1 1 1 1

Hello, May I know why the result of currency showing in digit? e.g. CURRENCY=344 for HKD instead of showing HKD? In "DIB" currency field is showing as "HKD"

icon clock
10 |1500

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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