Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
21 1 1 1

Unable to connect to APIPROXY even though http://localhost:9060/api/status works

Hi, I am having difficulty getting the Eikon Data API to work

I have followed the instructions here:
https://developers.refinitiv.com/en/api-catalog/eikon/eikon-data-api/quick-start
and have Registered an Application using APPKEY tool on my Eikon Terminal (that I run on the same machine I run my python script)

This works:
http://localhost:9060/api/status

{"statusCode":"ST_PROXY_READY","version":"3.3.2"}

This does not work:
http://localhost:9000/ping?all
HTTP Error 404. The requested resource is not found.

I am using eikon = 1.1.6 and I get the following exception when I call:

import eikon as ek

ek.set_log_level(1)

ek.set_app_key(<key>)

See below, I would appreciate your help. Thank you


2022-09-13 21:33:41,753 P[27] [MainThread 140347991713600] Warning: file .portInUse was not found. Try to fallback to default port number.
2022-09-13 21:33:41,759 P[27] [MainThread 140347991713600] Try defaulting to port 9000...
2022-09-13 21:33:41,760 P[27] [MainThread 140347991713600] Send GET request to http://127.0.0.1:9000/api/status to detect API Proxy...
2022-09-13 21:33:41,761 P[27] [MainThread 140347991713600] Request to http://127.0.0.1:9000/api/status
    headers = {'x-tr-applicationid': ''}
    params = None
2022-09-13 21:33:41,784 P[27] [MainThread 140347991713600] HTTP request failed: ConnectError('All connection attempts failed',)
2022-09-13 21:33:41,785 P[27] [MainThread 140347991713600] Error on checking proxy url http://127.0.0.1:9000/api/status : ConnectError('All connection attempts failed',)
2022-09-13 21:33:41,786 P[27] [MainThread 140347991713600] Default proxy port #9000 failed
2022-09-13 21:33:41,787 P[27] [MainThread 140347991713600] Try defaulting to port 9060...
2022-09-13 21:33:41,788 P[27] [MainThread 140347991713600] Send GET request to http://127.0.0.1:9060/api/status to detect API Proxy...
2022-09-13 21:33:41,789 P[27] [MainThread 140347991713600] Request to http://127.0.0.1:9060/api/status
    headers = {'x-tr-applicationid': 'xxxxxxxxxxxxxxxxxxxx'}
    params = None
2022-09-13 21:33:41,792 P[27] [MainThread 140347991713600] HTTP request failed: ConnectError('All connection attempts failed',)
2022-09-13 21:33:41,793 P[27] [MainThread 140347991713600] Error on checking proxy url http://127.0.0.1:9060/api/status : ConnectError('All connection attempts failed',)
2022-09-13 21:33:41,794 P[27] [MainThread 140347991713600] Default proxy port #9060 failed
2022-09-13 21:33:41,795 P[27] [MainThread 140347991713600] Error: no proxy address identified.
Check if Eikon Desktop or Eikon API Proxy is running.
2022-09-13 21:33:41,796 P[27] [MainThread 140347991713600] Try to handshake on url http://127.0.0.1:None/api/handshake...
2022-09-13 21:33:41,797 P[27] [MainThread 140347991713600] Request to http://127.0.0.1:None/api/handshake
    headers = {'Content-Type': 'application/json', 'x-tr-applicationid': 'xxxxxxxxxxxxxxxxxxxx'}
    params = None
2022-09-13 21:33:41,799 P[27] [MainThread 140347991713600] HTTP request failed: UnsupportedProtocol("Request URL is missing an 'http://' or 'https://' protocol.",)
2022-09-13 21:33:41,800 P[27] [MainThread 140347991713600] Error on handshake url http://127.0.0.1:None/api/handshake : UnsupportedProtocol("Request URL is missing an 'http://' or 'https://' protocol.",)
2022-09-13 21:33:41,801 P[27] [MainThread 140347991713600] Error on handshake url http://127.0.0.1:None/api/handshake : UnsupportedProtocol("Request URL is missing an 'http://' or 'https://' protocol.",)
2022-09-13 21:33:41,801 P[27] [MainThread 140347991713600] Port number was not identified, cannot send any request
2022-09-13 21:33:41,803 P[27] [MainThread 140347991713600] Received notification for closed streaming session 0
2022-09-13 21:33:41,804 P[27] [MainThread 140347991713600] Received notification for closed streaming session 0
2022-09-13 21:33:41,805 P[27] [MainThread 140347991713600] Init a Desktop session with new app_key
eikon-data-apipython apiappkey
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
21 1 1 1

Found the root cause. It was an error on my side. I was using a cloud-hosted Jupyter session rather than a local session of Jupyter! That is why the API could not connect to my PROXY.

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.

Upvote
14.3k 30 5 10

hi @ainhoa.dewismeoliva ,

Could you please try to restart your machine, the restart your Eikon Desktop.

Then follow article Eikon Data API (Python) Troubleshooting | Refinitiv, and test the instruction on step 3-6 and 3-7 to make sure that the API Proxy is running properly.

If this still does not help with the issue, you can submit a product support ticket on MyRefinitiv and ask the helpdesk to escalate the issue to the Technical Service Group.

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
21 1 1 1

thank you @raksina.samasiri -I have already followed the instructions you have shared but they didn't help unfortunately . I have restarted my Eikon desktop multiple times with no luck (have not restarted my machine, that is a bit drastic... but will do); I tried to raise a request on MyRefinitiv and I was advised to raise the question here.. I will try again.

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.