Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
58 0 1 3

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

#technologyerrornewsdebugging
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
58 0 1 3

@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

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvote
80k 257 52 75

@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?


1690779943845.png (16.3 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.