Check if Eikon Data API is connected to the proxy

What is the best way to test in Python whether the Eikon Proxy is running?

When I run the set_app_key function I sometimes get an error saying ""Error on checking port 9000". This error is caused as Eikon has no running connection as I might be logged in on my mobile phone although Eikon is still running on my Desktop.

Thanks for your help.

Best Answer

  • If you use the latest version of Eikon Data APIs library for Python (v1.0.1) and you execute get_data or get_timeseries methods when Eikon API Proxy is not available, the methods will throw an exception "EikonError: Error code 401 | Eikon Proxy not installed or not running. Please read the documentation to know how to install and run the proxy." This exception can be easily trapped using try... except.

    try:
    ek.get_timeseries('TRI.N')
    except ek.EikonError as err:
    if err.code == 401:
    print("Eikon API Proxy is not available")
    For this reason I'm not sure what value a separate from a data retrieval call test if Eikon API Proxy is available would provide. But if for whatever reason you need such a test, then calling set_app_key is your best bet.