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

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

eikon-data-api#technologypython apisslcertificate
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
22.6k 59 14 21

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")
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.

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")
Upvotes
22.6k 59 14 21

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.


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
80.1k 257 52 75

@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.


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

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

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.