for PYTHON API

import eikon as ek

API = ek.set_app_id('ECC3299DC668A7E4F5B9714F')

while True:

API = ek.set_app_id('ECC3299DC668A7E4F5B9714F')

print(API)

Data = ek.get_timeseries(['GGAL.O'], start_date='2017-01-10' , end_date='2018-07-12')

print(DATA)

Data.to_csv('ADR_GGAL.O_ACTUALIZADO.csv',decimal=",",sep=";"))

I want to read my api constantly and have it printed on the screen. I do not know if my code is correct, I would like you to help me. On the other hand, it gives me an error: HTTPError: <Response [403]>

Best Answer

  • @pablo
    In addition to comments from @nick.zincone.1 the app ID you're using is no longer valid, which is the reason you receive HTTP 403 response to your data requests. About a month ago Thomson Reuters started validating the app keys used in applications utilizing Eikon Data APIs. Prior to this all participants in the Beta program for Eikon Data APIs were notified via email of the upcoming change and that they would need to generate new API keys using a new App Key Generator app. It appears that some users either missed this notification or didn't receive it. Long story short what you need to do is generate a new app key following the procedure described in the Quick Start Guide for Eikon Data APIs, which was updated. Please make sure to use the App Key Generator app to generate the new app key.
    You may also want to update the eikon Python library from pip to the latest version 0.1.13, which among other things provides more explicit error messages. If you were using this version of the eikon Python library you'd see in the error message that the app key you use is invalid.

Answers

  • Hi @pablo,

    The call to 'set_app_id' should only happen once, at the start of your application, not in a while loop. This set_app_id() effectively establishes a session with Eikon to enable you to request data, which you only need to do once.

    As for the above calls to get_timeseries and save it to a file, those lines work fine. I don't know what you mean by "I want to read my api constantly". Can you elaborate?