q = "R:VOD.L AND Topic:GB" headlines = tr.get_news_headlines(query=q, date_from=start_date, date_to=end_date, count=100)
Hi, how can I modify the python request above to get:
1. All News
2. A 1000 news, not just 100.
Hi @Laarni Evelyn Acierto.Santiago,
The get_news_headlines() method does define an upper limit of 100 results. When you look at the results based on the date criteria, the request will retrieve the last N headlines, up to 100, based on your date_to specification. For example,
In the above query, my results went back as far as 2018-01-19. Unfortunately, in order for you to retrieve additional headlines, you will have to execute multiple get_news_headlines() queries based on different date ranges.
In addition to the response from @nick.zincone and to answer the first question, to retrieve all news headlines without applying any filters you can use the news query "A". To learn how to construct news filter expressions use the News Monitor app in Eikon application, which provides GUI for constructing news filters. In get_news_headlines method you can use the same news codes and filter expressions that you can use in the News Monitor app in Eikon. If you're not familiar with News Monitor app in Eikon, you can find series of video tutorials by going to the main Eikon menu and selecting Help - Tutorials and Training and typing in "news" in the search box of the Training app.
Thanks. Can you add a time to each date?
Thanks. However I've tried q = "A" and it didn't work.
Thanks. 15 months is too short for our purposes. We might have to find an alternative news source.
Hi again
I'm getting intermittent timeout errors like this:
"HTTPError: Request timeout occured"
With the following code:
q = 'Language:LEN AND ( Topic:GLOFIN OR Topic:TOPNWS ) NOT (Source:TRAUT OR ECLCTA OR ECLTND OR ECLPCM OR ECLBFI OR TOPIC:ENT OR JOB OR SPO OR BACT OR STXOPS OR INTER OR MTPDF OR VID OR REP OR VEN OR INFO OR ORDIMB OR NPL OR WEA OR ENV OR TXT OR PCARD OR INSI OR RSUM OR PREV OR OBIT OR NMKR OR NEWR OR FILING OR ADVS OR AAA OR MEVN OR RCH OR PRO OR PPLMOV)'
headlines = tr.get_news_headlines(query=q, date_from=start_date, date_to=end_date, count=100)
Can you please let me know what can I do to stop these intermittent timeouts?
Thanks,
Jordi
Is there any pattern to the timeouts you experienced? Do you have a way of reproducing these timeouts that you could share? I just tried using your news search expression to retrieve the headlines for the past 24 hours in a loop retrieving the headlines for a 30 minute window at a time, and I did not encounter any problems.
You may want to consider a Thomson Reuters news feed product, which provides the full depth of TR news archive.https://financial.thomsonreuters.com/en/products/data-analytics/financial-news-feed.html