Problem with eikon API

We are experiencing the issue on Eikon API after restarting PC.


Version: Desktop 4.0.56


>>> import eikon as ek
>>> print(ek.__version__)
1.1.14


http://localhost:9000/api/status
Cannot GET /api/status

http://localhost:9000/api/data/v1
Cannot GET /api/data/v1

http://localhost:9000/ping?all
{"port":9000,"mode":"eikon4","pid":11644,"hasSecure":true,"startedTime":"Fri Feb 11 2022 12:13:42 GMT+0100 (Paris, Madrid)","subApps":[{"path":"/heap"},{"path":"/ping"},{"path":"/sxs","data":{"hasSecure":true,"sxsApps":{}}},{"path":"/sxs/v1/services/messenger"}]}

http://127.0.0.1:9000/api/handshake.
Cannot GET /api/handshake.


>>> import eikon as ek
>>> ek.set_log_level(1)
>>> ek.set_app_key('apikey')
2022-02-11 13:08:56,465 P[13028] [MainThread 7332] Reset a Desktop session with new app_key
2022-02-11 13:08:56,465 P[13028] [MainThread 7332] Unlock login_event for streaming session 0 due to stop streaming call
2022-02-11 13:08:56,480 P[13028] [MainThread 7332] Send GET request to http://127.0.0.1:9000/api/status to detect API Proxy...
2022-02-11 13:08:56,480 P[13028] [MainThread 7332] Request to http://127.0.0.1:9000/api/status
headers = {'x-tr-applicationid': 'apikey'}
params = None
2022-02-11 13:08:56,496 P[13028] [MainThread 7332] HTTP request response 404: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /api/status</pre>
</body>
</html>

2022-02-11 13:08:56,496 P[13028] [MainThread 7332] Checking proxy url http://127.0.0.1:9000/api/status response : 404 - <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /api/status</pre>
</body>
</html>

2022-02-11 13:08:56,512 P[13028] [MainThread 7332] Port 9000 was retrieved from .portInUse file
2022-02-11 13:08:56,512 P[13028] [MainThread 7332] Try to handshake on url http://127.0.0.1:9000/api/handshake...
2022-02-11 13:08:56,512 P[13028] [MainThread 7332] Request to http://127.0.0.1:9000/api/handshake
headers = {'Content-Type': 'application/json', 'x-tr-applicationid': 'apikey'}
params = None
2022-02-11 13:08:56,512 P[13028] [MainThread 7332] HTTP request response 404: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /api/handshake</pre>
</body>
</html>

2022-02-11 13:08:56,512 P[13028] [MainThread 7332] Response : 404 - <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /api/handshake</pre>
</body>
</html>

2022-02-11 13:08:56,512 P[13028] [MainThread 7332] Response 404 on handshake url http://127.0.0.1:9000/api/handshake : <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /api/handshake</pre>
</body>
</html>

2022-02-11 13:08:56,512 P[13028] [MainThread 7332] Application ID: apikey
2022-02-11 13:08:56,512 P[13028] [MainThread 7332] Init a Desktop session with new app_key
>>>


Can somebody help to identify and resolve API connection issues ?

Thank you.

Best Answer

  • pf
    pf
    Answer ✓

    Hi @Magouloub ,

    According to "Cannot GET /api/status " response on request to http://127.0.0.1:9000/api/status, it seems that API Proxy isn't running in your Eikon.

    This could be due to your Eikon Variant model.
    You can follow this thread for information on availability of Eikon Data APIs in various Eikon variants.

    The second possibility (if it worked before) is coming from a failure of API Proxy. Do you reproduce the issue if you restart Eikon ?

    Could you check http://127.0.0.1:9000/api/status result in a browser ?
    It should be something like :

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


Answers

  • Hi,

    I have the same error after restarting PC and Eikon:


    http://localhost:9000/api/status

    Cannot GET /api/status


    I tried to change 9000 to 9060 and restart eikon but nothing changed

    C:\Users\LOGIN\AppData\Roaming\Thomson Reuters\Eikon API Proxy\.portInUse

  • Did it work recently ?
    This seems to be due to your Eikon Variant model.
    According to this thread, the Python feature should be available in Eikon Premium only. Please contact your account manager to discuss options that meet your needs.