Error on handshake

onionw
onionw Newcomer
edited March 11 in Eikon Data APIs

Hello,

I am facing error below, it was working ok last week.

python version: 3.11.5
eikon desktop: 4.0.54

ek version: 1.1.18

ek.set_app_key(EIKON_KEY)

2025-03-10 16:33:03,902 P[30228] [MainThread 6100] Error on handshake url http://127.0.0.1:9060/api/handshake : ReadTimeout('')
2025-03-10 16:33:03,902 P[30228] [MainThread 6100] Error on handshake url http://127.0.0.1:9060/api/handshake : ReadTimeout('')
2025-03-10 16:33:03,902 P[30228] [MainThread 6100] Port number was not identified, cannot send any request

I have done - clear cache, restart PC, restart EIKON.

image.png image.png image.png

"localhost:9001/ping?all" doesn't work though.

IN SxSxxxxxx file, it seems correct to me

[2025-03-10 16:30:07.026|1|api-svc|1|INFO] Start server...
[2025-03-10 16:30:07.026|1|api-svc|2|DEBUG] onStarted: 9000
[2025-03-10 16:30:07.026|1|api-svc|1|INFO] Listening to port=9000
[2025-03-10 16:30:07.853|1|data-api|1|INFO] API Proxy is available on port 9060. Start redirecting /api/* requests
[2025-03-10 16:30:08.468|1|sxs-api|3|DEBUG] [event] onMclEvents
[2025-03-10 16:30:11.679|1|api-svc|0|WARN] Error: messenger not found.
[2025-03-10 16:30:11.682|1|sxs-api|3|DEBUG] [ws] Create endpoint=/sxs/v1/services/messenger

please advise what I could do to fix issue?

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @onionw

    Thank you for reaching out to us.

    You need to use the new LSEG Data Library for Python instead. It supports the http request timeout and loggin configurations. For example:

    config = ld.get_config()
    config.set_param("logs.transports.console.enabled", True)
    config.set_param("logs.level", "debug")
    config.set_param("logs.transports.file.name", "lseg-data-lib.log")
    config.set_param("http.request-timeout", 6000)
    ld.open_session()
    

    The examples are on GitHub.

    If this doesn't solve this issue, please share the lseg-data-lib.log file.

  • onionw
    onionw Newcomer

    hello,

    I have run this "pip install lseg-data" to install lib.

    Installing collected packages: pyhumps, websocket-client, simplejson, pyee, lseg-data
    Attempting uninstall: websocket-client
    Found existing installation: websocket-client 0.58.0
    Uninstalling websocket-client-0.58.0:
    Successfully uninstalled websocket-client-0.58.0
    Successfully installed lseg-data-2.0.1 pyee-11.1.0 pyhumps-3.8.0 simplejson-3.20.1 websocket-client-1.8.0

    this is the code:

    image.png


    error:

    image.png

    did I miss anything?

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @onionw

    Can you try this code? Please change the <app key>. The TCP port in the code is 9000.

    import requests
    body = {
    "AppKey": "<app key>",
    "AppScope": "rapi",
    "ApiVersion": "1",
    "LibraryName": "Eikon Python Library",
    "LibraryVersion": "1.1.18"
    }
    r = requests.post(url="http://127.0.0.1:9000/api/handshake",
    headers={"Host":"127.0.0.1","Content-Type": "application/json"},
    json=body)
    print(r)
    print("HANDSHAKE:\n", r.text)
    

    image.png
  • onionw
    onionw Newcomer
    edited March 11

    actually, our IT support team reinstalled a latest version EIKON, it works for me now. Thanks

    I have another question then, I have posted it in new thread, could you pls help?

    what is the best way to query EXPIR_DATE, SETTLEPRICE for both brent and gasoil futures from 2020 to 2024? does this get_history() work? what is universe ric to use?

    import lseg.data as ld

    df = ld.get_history()

    Is there an API doc for us to search all api available to us to use?

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    Thank you for sharing.

    The document is here and the examples are on GitHub.

    You need to know RICs in order to call the get_history method. You can refer to the following articles:

    Reconstructing RICs for expired futures contracts

    Building Search into your Application Workflow