EikonError-Backend error. 503 Service Unavailable

I am fetching the news headlines data using python but this error has been occurring lately. Been using the same script and could fetch 100 headlines day before yesterday but works no more.

Here is the script:_

pip install eikon

import eikon as ek

ek.set_app_key('###')

import pandas as pd

import numpy as np

import datetime

from datetime import time

import warnings

warnings.filterwarnings("ignore")

dfE = ek.get_news_headlines(' ( ( Topic:CNEUT OR Topic:GRNTCH OR Topic:CAROFF Topic:ENVBIO OR Topic:ESGENV OR Topic:ESGGOV OR Topic:ESGREG OR Topic:ENVJUS OR "Environmental Commitment" OR "ESG Investment Commitment" OR Topic:ESG OR "Environmental Social Governance" OR Topic:ENVREG OR "Restriction of Competition" OR "Competition Agreement" OR Topic:FESGD ) AND Topic:DE AND ( Language:LEN OR Language:LDE ) AND ( "ESG Dispute" OR "dispute" OR "ESG Damage" OR "Greenwashing" OR "damage" ) )',date_from ="2023-12-01" ,date_to = "2023-12-19",count=10)

dfE.head()

1703239937977.png

Kindly provide me some solution to fix it or any alternative to fetch news headlines data

Best Answer

  • Hi @shreesharma ,


    According to this thread the library will through this error when there are more than 100 headlines per request. I have checked the same request using RD Libraries for Python (which is using different service for this) and it works for me:


    import refinitiv.data as rd
    rd.open_session()
    dfE = rd.news.get_headlines(' ( ( Topic:CNEUT OR Topic:GRNTCH OR Topic:CAROFF Topic:ENVBIO OR Topic:ESGENV OR Topic:ESGGOV OR Topic:ESGREG OR Topic:ENVJUS OR "Environmental Commitment" OR "ESG Investment Commitment" OR Topic:ESG OR "Environmental Social Governance" OR Topic:ENVREG OR "Restriction of Competition" OR "Competition Agreement" OR Topic:FESGD ) AND Topic:DE AND ( Language:LEN OR Language:LDE ) AND ( "ESG Dispute" OR "dispute" OR "ESG Damage" OR "Greenwashing" OR "damage" ) )',start ="2023-12-01" ,end = "2023-12-19",count=100)
    dfE

    screenshot-2023-12-22-at-103608.png


    Hope this helps.


    Best regards,

    Haykaz

Answers

  • Thanks for your inputs.

    I have a refinitv desktop workspace where i generated the app key.
    While opening a session, there is an error stating invalid credentials in my config file.
    But do i need to take RDP login and password from support team or is it same as my login credential for desktop eikon workspace?

    Regards,
    Shreeya

  • Hi @shreesharma ,


    The credentials should be the same. Moreover, in RD you just need to run rd.open_session() without providing the app key assuming you are trying to connect via the desktop session and have LSEG Workspace running on the background. The library will pick the app key from the Workspace

    If you want to connect using platform session, you would need to have enterprise license (when there is no need for Workspace running on the background) which comes with machine ID and password on top of the app key. You can use the configuration examples here for that.


    Best regards,

    Haykaz