ek.get_news_headlines VALUERROR WHEN EMPTY

I have coded the following in Jupyter Notebook


headlines_1 = ek.get_news_headlines(query="FXBUZ AND CORRECTED", count=20, date_from=date_from_str, date_to=date_to_str)


Previously when I ran this, if the results were empty it would return and empty line. Now I get the following

---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[104], line 2
1 # Retrieve CORRECTED FX Buzz comment headlines with date and time
----> 2 headlines_1 = ek.get_news_headlines(query="FXBUZ AND CORRECTED", count=20, date_from=date_from_str, date_to=date_to_str)

File ~\AppData\Local\anaconda3\Lib\site-packages\eikon\news_request.py:126, in get_news_headlines(query, count, date_from, date_to, raw_output, debug)
124 return result

Best Answer

  • @Jirapongse thank you for confirming. I have same Eikon version, but I had swapped laptops and the newest Jupyter Notebook seems to have been the culprit. I have uninstalled and installed an earlier version via Anaconda and the problems seems to have gone away

Answers

  • @martin.miller01

    Thank you for reaching out to us.

    I ran the following code with Eikon Data API 1.1.17.

    headlines_1 = ek.get_news_headlines(query="FXBUZ AND CORRECTED", count=20, date_from="2023-07-01", date_to="2023-07-02")

    It can display the empty result properly.

    1690779943845.png

    Please verify the version of Eikon Data API that you are using. What are the values of the date_from and date_to parameters?