ek.get_news_headlines giving empty df for any query

I am getting any empty data frame result each time I query news headlines using the python API:

Empty DataFrame

Columns: [versionCreated, text, storyId, sourceCode]

Index: []


I have used working queries extracted from the forum and Yves's repositories but all result in an empty data frame.

rics = [

'AAPL.O', # Apple stock

'AMZN.O', # Amazon stock

'TSLA.O', # Tesla stock

'.SPX', # S&P 500 stock index

]


news = ek.get_news_headlines('R:%s PRODUCTION IN ENGLISH' % rics[2],

date_from='2018-02-01',

date_to='2018-02-14',

count=10

)

df = ek.get_news_headlines(query="R:PGA190 AND \\\"summary\\\" AND \\\"regrade\\\" AND \\\"deals\\\"")

news = ek.get_news_headlines('R:.SPX "TRUMP" Language:LEN',

date_from='2020-02-01',

date_to='2020-05-28',

count=100

)


Best Answer

  • chavalit-jintamalit
    Answer ✓

    Hi @wyczolko

    Please update the API version to 1.1.5

    pip install eikon --upgrade

    And please try this code:

    news = ek.get_news_headlines('R:TSLA.O AND \\"PRODUCTION\\" AND Language:LEN', date_from='2019-05-27', date_to='2019-06-09', count=100)

    news

    Please note that news is available from 15 months ago to today.

    image