setting verify=false for eikon get_timeseries call in python

Hi


I'm trying to fix some ssl certificate bugs by setting verify=false when making a timeseries call for the eikon api in python. Im doing like this:

import eikon as ek
ek.set_app_key('............')
X=ek.get_timeseries(["RICS code"], ['close'], start_date="2015-01-01", end_date="2024-02-04", verify=False)

In the end of the call though, its not possible to put verify=false. It gives me the error "TypeError: get_timeseries() got an unexpected keyword argument 'verify'".

Could anyone help me how to set verify=false in the correct way for eikon get_timeseries?

thx

Best Answer

  • Gurpreet
    Answer ✓

    If you want to disable SSL validity check, then you could try the following. The example shows news, but same approach can be used with other endpoints. Please note that this is only for the purpose of debugging an app under development and should never be used extensively or in a production setup.

    ek.set_app_key("--APP_KEY--")

    http_session = ek.Profile.get_profile()._get_desktop_session()

    # following request is the same than story = ek.get_news_story("urn:newsml:reuters.com:20240220:nDJRMLB92:1")

    http_response = http_session.http_request(
    url=http://127.0.0.1:9060/api/v1/data,
    method="POST",
    headers={
    "Content-Type": "application/json",
    "x-tr-applicationid": ek.get_app_key(),
    },
    json={
    "Entity": {
    "E": "News_Story",
    "W": {
    "attributionCode": "",
    "productName": "--APP_KEY--",
    "silent": True,
    "storyId": "urn:newsml:reuters.com:20240220:nDJRMLB92:1",
    },
    }
    },
    verify=False,
    )
    json_data = http_response.json()
    html_data = json_data.get("story").get("storyHtml")

Answers

  • Hi @rasmus.schnejder,

    The get_timeseries API call does not have any parameter named verify. You are confusing it with verify=False commonly used in Python Requests module - which should not be used either due to security issues.

    I would recommend that you upgrade your Python instance and the associated certificate store, so that the SSL verification check is passed.


  • @rasmus.schnejder

    The Eikon Data API retrieves data via the http protocol (not https) which is running on the localhost. I am not sure why you need to set verify to false.

    If you get the ssl certificate issue, it could be the problem in the Eikon or Refinitiv Workspace processes.


  • With latest version of httpx library, this code will fail, but following code should fix:

    ek.set_app_key("--APP_KEY--")

    desktop_session = ek.Profile.get_profile()._get_desktop_session()
    desktop_session._http_session = httpx.AsyncClient(
    headers={"Accept": "application/json"}, timeout=60, verify=False
    )

    X = ek.get_timeseries(["RICS code"], ['close'], start_date="2015-01-01", end_date="2024-02-04")
  • Thx for your answers. We got problem solved by changing user settings on my eikon setup. So Jirapongse was right about problem coming from Eikon Workspace process.

    Rasmus