question

Upvotes
Accepted
3 1 4 7

Unable to connect to Refinitiv using refinitiv-data module

Hello, I am using following code to connect to Refinitiv using refinitiv-data module. However, I am getting error while connecting.

Code Snippet:

import refinitiv.data as rd

rd.session.platform.Definition(
    app_key = '9505**********************',
    grant = rd.session.platform.GrantPassword(
        username = 'lisa*****',
        password = '********'
    )
).get_session()

rd.open_session()

df = rd.get_data(
    universe=['IBM.N', 'VOD.L'],
    fields=['BID', 'ASK', 'TR.Revenue']
)
print(df)

Error:

An error occurred while requesting URL('http://localhost:9000/api/status').

ConnectError('[WinError 10061] No connection could be made because the target machine actively refused it')

An error occurred while requesting URL('http://localhost:9060/api/status').

ConnectError('[WinError 10061] No connection could be made because the target machine actively refused it')

Error: no proxy address identified.

Check if Desktop is running.

An error occurred while requesting URL('http://localhost:9000/api/handshake').

ConnectError('[WinError 10061] No connection could be made because the target machine actively refused it')


Please can you point out what is going wrong.


Thanks

#technology#productrefinitiv-data-platformrefinitiv-dataplatform-libraries
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.

1 Answer

· Write an Answer
Upvotes
Accepted
81.1k 264 53 76

@lisa.mcentee

Sorry about the issue that you are facing.

According to the provided code, you would like to use the platform session to connect the Refinitiv Data Platform API. However, the error indicates that you are connecting to the desktop session.

To create a Platform session using an App Key and GrantPassword, the code looks like this:

session = rd.session.platform.Definition(
    app_key = APP_KEY, 
    grant = rd.session.platform.GrantPassword(
        username = RDP_LOGIN, 
        password = RDP_PASSWORD
    )
).get_session()

session.open()

rd.session.set_default(session)

After that, you can call the rd.get_data method to retrieve the data.

I hope that this information is of 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.

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.