Python APi Eikon get data is not Fetching ( error 502) ,

ek.get_data(["0#.SPX"],[{'TR.CompanyMarketCap':{'sort_dir':'desc'}}]), 

This is the code I'm using to fetch data from eikon, but unfortunately it throwing me an error, (error 502)

Please help me with this issue.

Thank you

Best Answer

  • Jirapongse
    Jirapongse admin
    Answer ✓

    @Akhilesh.Kumar

    I can run it properly.

    df, err = ek.get_data(["0#.SPX"],[{'TR.CompanyMarketCap':{'sort_dir':'desc'}}])

    1654672339178.png

    You can enable logging in the API to verify the problem.

    ek.set_log_level(1)
    ek.set_app_key('<app key>')

Answers


  • Yes the code is fine, but for some reason in my system it throws this error and doesn't fetch the values.

    eikon.eikonError.EikonError: Error code 502 | Server Error:

    Let me know your thoughts.

  • @Akhilesh.Kumar

    Please enable logging and share it. You can use the below code to enable logging.

    ek.set_log_level(1)
    ek.set_app_key('<app key>')
  • Hello @Akhilesh.Kumar ,

    Were you able to enable logging as suggested by @Jirapongse ?

    Please share by zipping and attaching, or share the relevant excerpt so that we can progress with this discussion and try to help with the issue.