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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 1 3

output from get_news_headlines is not within specified date range?

news = ek.get_news_headlines(query='R:CNH= and Language:LEN', date_from='2019-05-13', date_to='2019-05-13', count=50 )

for i in news.index: print(i, ' ' , news['text'][i])

From the code snippet above, I got the below output:

2019-05-20 11:18:33.150000   MORNING VIEW: LME base metals prices under pressure while trade dispute continues
2019-05-20 11:18:32.952000   Weak Turkish lira, renewed US-China tensions dampen Vietnam's HRC demand
eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
icon clock
10 |1500

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

Upvotes
Accepted
3.8k 4 4 6

Hi @Luke@MBBS

The story can be created and then modified later on. Please have a look at another example where you see more news that were created before a certain date and then consecutively updated. Basically the function is looking for news stories with certain topic or RIC in a defined time period (column versionCreated) which is an intuitive search from an end user perspective.

ek.get_news_headlines(query='Topic:TAL', date_from='2019-05-22T00:00:01', date_to='2019-05-22T23:59:59')
icon clock
10 |1500

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

Upvotes
3.8k 4 4 6

@Luke@MBBS

Can you try using datetime format:

news = ek.get_news_headlines(query='R:CNH= and Language:LEN', date_from='2019-05-13T00:00:00', date_to='2019-05-13T23:59:59', count=50)


datetime.jpg (34.0 KiB)
icon clock
10 |1500

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

Upvotes
1 0 1 3

hi @marcin.bunkowski, I tried the below and the first item I get is 22 march 2019

news = ek.get_news_headlines(query='R:CNH= and Language:LEN', date_from='2019-05-13T00:00:00', date_to='2019-05-13T23:59:59', count=50) for i in news.index: print(i, ' ' , news['text'][i])

I got:

2019-03-22 05:07:31   TAKE A LOOK-Asia inflation: India April retail rate highest in 6 months
2019-05-13 23:50:38   BUZZ-USD/CNH on path to 6.9800; test of nerves for authorities
2019-05-13 23:36:38   BUZZ-USD/CNH-Holds at 4-month high as China hits back
2019-05-13 23:10:22   BUZZ-Asia Day Ahead-Focus on repricing the U.S./China trade war
2019-05-13 22:54:31   UPDATE 1-Bitcoin tops $8,000 as it hits highest since July 2018
2019-05-13 22:06:14   BUZZ-AUD/USD-Trade war escalation renders major Fibo vulnerable
2019-05-13 21:49:35   BITCOIN PRICE TOPS $8,000 FOR FIRST TIME SINCE JULY 2018, RISES 16 PCT <BTC=BTSP>
2019-05-13 21:46:42.574000   Briefing.com: Fed Brief/BBI
2019-05-13 21:44:24.776000   Dow drops over 600 points as tariff war heats up; TSX proves resilient Canadian stocks escape with only minor losses thanks to gold, more attractive valuations
2019-05-13 21:33:21.674000   Sensex falls for 9th day, Nifty logs longest losing streak since 2011
2019-05-13 21:30:39.475000   Don't count on Donald Trump saving the stock market Anyone counting on the White House to rush to the aid of share prices after the market swoon on Monday is likely to be disappointed
2019-05-13 21:20:10.031000   Asia may help hasten end of U.S. dollar era Asean+3 has been mulling adding yuan and yen to reserve currency fund, a move analysts see as part of slow decline of American financial hegemony
2019-05-13 21:20:09.757000   LME set to revisit commodities connect scheme Three-stage plan to link London and Hong Kong exchanges will begin with six metals contracts
2019-05-13 20:50:18.300000   2019 First Quarter Financial Results
2019-05-13 20:48:14.397000   Briefing.com: Stock Market Update - 16:20 ET
2019-05-13 20:47:11.252000   Briefing.com: Stock Market Update - 16:20 ET
2019-05-13 20:19:25   GLOBAL MARKETS-Stocks dive, yuan weakens as U.S.-China trade fight intensifies
2019-05-13 20:18:26   LIVE MARKETS U.S.-Stocks trounced as trade war intensifies
2019-05-13 20:17:20.579000   Briefing.com: Hourly In Play (R) - 16:00 ET
2019-05-13 20:16:37.713000   Briefing.com: Bond Market Update - 15:55 ET
2019-05-13 19:47:03.112000   Briefing.com: Stock Market Update - 15:35 ET
2019-05-13 19:16:51.345000   Briefing.com: Stock Market Update - 14:55 ET
2019-05-13 19:06:39   BUZZ-Replay-Trade fear, aussie flashback, retail therapy
2019-05-13 18:51:29   Trump says U.S. farmers to get $15 bln in aid amid China trade spat
2019-05-13 18:41:44   2019-05-13 18:41:44    TRUMP SAYS U.S. PLANS TO PROVIDE ABOUT $15 BIL...
2019-05-13 18:41:44    TRUMP SAYS CHINA WILL PROBABLY RETALIATE AGAIN...
Name: text, dtype: object
2019-05-13 18:46:23.623000   Briefing.com: Stock Market Update - 14:30 ET
2019-05-13 18:41:44   2019-05-13 18:41:44    TRUMP SAYS U.S. PLANS TO PROVIDE ABOUT $15 BIL...
2019-05-13 18:41:44    TRUMP SAYS CHINA WILL PROBABLY RETALIATE AGAIN...
Name: text, dtype: object
2019-05-13 18:41:44.640000   TRUMP SAYS PORTION OF FUNDS U.S. TAKES IN FROM TARIFFS ON CHINESE IMPORTS WILL GO TO U.S. FARMERS
2019-05-13 18:35:35   LIVE MARKETS U.S.-Trade talks: It's complicated
2019-05-13 18:25:11   Trump says he will meet China's Xi and Russia's Putin at G20
2019-05-13 18:19:09   2019-05-13 18:19:09    TRUMP SAYS HE HAS NOT MADE THE DECISION TO GO ...
2019-05-13 18:19:09    TRUMP SAYS  HE WILL MEET WITH XI AND PUTIN AT G20
2019-05-13 18:19:09    TRUMP SAYS CHINA'S BACKTRACKING IN TRADE TALKS...
2019-05-13 18:19:09    TRUMP SAYS U.S. HAD A DEAL WITH CHINA, HE SAYS...
2019-05-13 18:19:09     TRUMP SAYS U.S. IS IN A GREAT POSITION RIGHT NOW
2019-05-13 18:19:09    TRUMP SAYS U.S.-CHINA MEETING AT G20 COULD BE ...
2019-05-13 18:19:09    TRUMP SAYS THERE CAN BE SOME RETALIATION IN U....
2019-05-13 18:19:09    TRUMP, WITHOUT PROVIDING SPECIFICS IN DISCUSSI...
Name: text, dtype: object
2019-05-13 18:19:09   2019-05-13 18:19:09    TRUMP SAYS HE HAS NOT MADE THE DECISION TO GO ...
2019-05-13 18:19:09    TRUMP SAYS  HE WILL MEET WITH XI AND PUTIN AT G20
2019-05-13 18:19:09    TRUMP SAYS CHINA'S BACKTRACKING IN TRADE TALKS...
2019-05-13 18:19:09    TRUMP SAYS U.S. HAD A DEAL WITH CHINA, HE SAYS...
2019-05-13 18:19:09     TRUMP SAYS U.S. IS IN A GREAT POSITION RIGHT NOW
2019-05-13 18:19:09    TRUMP SAYS U.S.-CHINA MEETING AT G20 COULD BE ...
2019-05-13 18:19:09    TRUMP SAYS THERE CAN BE SOME RETALIATION IN U....
2019-05-13 18:19:09    TRUMP, WITHOUT PROVIDING SPECIFICS IN DISCUSSI...
Name: text, dtype: object
2019-05-13 18:19:09   2019-05-13 18:19:09    TRUMP SAYS HE HAS NOT MADE THE DECISION TO GO ...
2019-05-13 18:19:09    TRUMP SAYS  HE WILL MEET WITH XI AND PUTIN AT G20
2019-05-13 18:19:09    TRUMP SAYS CHINA'S BACKTRACKING IN TRADE TALKS...
2019-05-13 18:19:09    TRUMP SAYS U.S. HAD A DEAL WITH CHINA, HE SAYS...
2019-05-13 18:19:09     TRUMP SAYS U.S. IS IN A GREAT POSITION RIGHT NOW
2019-05-13 18:19:09    TRUMP SAYS U.S.-CHINA MEETING AT G20 COULD BE ...
2019-05-13 18:19:09    TRUMP SAYS THERE CAN BE SOME RETALIATION IN U....
2019-05-13 18:19:09    TRUMP, WITHOUT PROVIDING SPECIFICS IN DISCUSSI...
Name: text, dtype: object
2019-05-13 18:19:09   2019-05-13 18:19:09    TRUMP SAYS HE HAS NOT MADE THE DECISION TO GO ...
2019-05-13 18:19:09    TRUMP SAYS  HE WILL MEET WITH XI AND PUTIN AT G20
2019-05-13 18:19:09    TRUMP SAYS CHINA'S BACKTRACKING IN TRADE TALKS...
2019-05-13 18:19:09    TRUMP SAYS U.S. HAD A DEAL WITH CHINA, HE SAYS...
2019-05-13 18:19:09     TRUMP SAYS U.S. IS IN A GREAT POSITION RIGHT NOW
2019-05-13 18:19:09    TRUMP SAYS U.S.-CHINA MEETING AT G20 COULD BE ...
2019-05-13 18:19:09    TRUMP SAYS THERE CAN BE SOME RETALIATION IN U....
2019-05-13 18:19:09    TRUMP, WITHOUT PROVIDING SPECIFICS IN DISCUSSI...
Name: text, dtype: object
2019-05-13 18:19:09   2019-05-13 18:19:09    TRUMP SAYS HE HAS NOT MADE THE DECISION TO GO ...
2019-05-13 18:19:09    TRUMP SAYS  HE WILL MEET WITH XI AND PUTIN AT G20
2019-05-13 18:19:09    TRUMP SAYS CHINA'S BACKTRACKING IN TRADE TALKS...
2019-05-13 18:19:09    TRUMP SAYS U.S. HAD A DEAL WITH CHINA, HE SAYS...
2019-05-13 18:19:09     TRUMP SAYS U.S. IS IN A GREAT POSITION RIGHT NOW
2019-05-13 18:19:09    TRUMP SAYS U.S.-CHINA MEETING AT G20 COULD BE ...
2019-05-13 18:19:09    TRUMP SAYS THERE CAN BE SOME RETALIATION IN U....
2019-05-13 18:19:09    TRUMP, WITHOUT PROVIDING SPECIFICS IN DISCUSSI...
Name: text, dtype: object
2019-05-13 18:19:09   2019-05-13 18:19:09    TRUMP SAYS HE HAS NOT MADE THE DECISION TO GO ...
2019-05-13 18:19:09    TRUMP SAYS  HE WILL MEET WITH XI AND PUTIN AT G20
2019-05-13 18:19:09    TRUMP SAYS CHINA'S BACKTRACKING IN TRADE TALKS...
2019-05-13 18:19:09    TRUMP SAYS U.S. HAD A DEAL WITH CHINA, HE SAYS...
2019-05-13 18:19:09     TRUMP SAYS U.S. IS IN A GREAT POSITION RIGHT NOW
2019-05-13 18:19:09    TRUMP SAYS U.S.-CHINA MEETING AT G20 COULD BE ...
2019-05-13 18:19:09    TRUMP SAYS THERE CAN BE SOME RETALIATION IN U....
2019-05-13 18:19:09    TRUMP, WITHOUT PROVIDING SPECIFICS IN DISCUSSI...
Name: text, dtype: object
2019-05-13 18:19:09   2019-05-13 18:19:09    TRUMP SAYS HE HAS NOT MADE THE DECISION TO GO ...
2019-05-13 18:19:09    TRUMP SAYS  HE WILL MEET WITH XI AND PUTIN AT G20
2019-05-13 18:19:09    TRUMP SAYS CHINA'S BACKTRACKING IN TRADE TALKS...
2019-05-13 18:19:09    TRUMP SAYS U.S. HAD A DEAL WITH CHINA, HE SAYS...
2019-05-13 18:19:09     TRUMP SAYS U.S. IS IN A GREAT POSITION RIGHT NOW
2019-05-13 18:19:09    TRUMP SAYS U.S.-CHINA MEETING AT G20 COULD BE ...
2019-05-13 18:19:09    TRUMP SAYS THERE CAN BE SOME RETALIATION IN U....
2019-05-13 18:19:09    TRUMP, WITHOUT PROVIDING SPECIFICS IN DISCUSSI...
Name: text, dtype: object
2019-05-13 18:19:09   2019-05-13 18:19:09    TRUMP SAYS HE HAS NOT MADE THE DECISION TO GO ...
2019-05-13 18:19:09    TRUMP SAYS  HE WILL MEET WITH XI AND PUTIN AT G20
2019-05-13 18:19:09    TRUMP SAYS CHINA'S BACKTRACKING IN TRADE TALKS...
2019-05-13 18:19:09    TRUMP SAYS U.S. HAD A DEAL WITH CHINA, HE SAYS...
2019-05-13 18:19:09     TRUMP SAYS U.S. IS IN A GREAT POSITION RIGHT NOW
2019-05-13 18:19:09    TRUMP SAYS U.S.-CHINA MEETING AT G20 COULD BE ...
2019-05-13 18:19:09    TRUMP SAYS THERE CAN BE SOME RETALIATION IN U....
2019-05-13 18:19:09    TRUMP, WITHOUT PROVIDING SPECIFICS IN DISCUSSI...
Name: text, dtype: object
2019-05-13 18:19:09.839000   TRUMP SAYS U.S. CAN NOT LET CHINA TAKE ADVANTAGE OF IT ANY LONGER
2019-05-13 18:16:23.530000   Briefing.com: Stock Market Update - 14:00 ET
2019-05-13 18:16:11.037000   Briefing.com: Stock Market Update - 14:00 ET
2019-05-13 18:11:24   BUZZ-AUD/USD knocked to four-month lows on trade war
2019-05-13 18:06:35   BUZZ-COMMENT-Trade headache may leave Fed yearning for retail therapy
2019-05-13 17:29:54   2019-05-13 17:29:54    KAPLAN SAYS THE BEST THING THE FED CAN DO ON R...
2019-05-13 17:29:54    FED'S KAPLAN SAYS I DON'T THINK WE SHOULD BE C...
2019-05-13 17:29:54    FED'S KAPLAN SAYS FOR NOW FED'S RATE SETTING I...
2019-05-13 17:29:54    KAPLAN SAYS TRADE RELATIONSHIPS, PARTICULARLY ...
2019-05-13 17:29:54    KAPLAN SAYS HE IS HOPEFUL WILL WORK SOMETHING ...
2019-05-13 17:29:54    KAPLAN SAYS TARIFFS PUT SAND IN THE GEARS FOR ...
Name: text, dtype: object
2019-05-13 17:29:54   2019-05-13 17:29:54    KAPLAN SAYS THE BEST THING THE FED CAN DO ON R...
2019-05-13 17:29:54    FED'S KAPLAN SAYS I DON'T THINK WE SHOULD BE C...
2019-05-13 17:29:54    FED'S KAPLAN SAYS FOR NOW FED'S RATE SETTING I...
2019-05-13 17:29:54    KAPLAN SAYS TRADE RELATIONSHIPS, PARTICULARLY ...
2019-05-13 17:29:54    KAPLAN SAYS HE IS HOPEFUL WILL WORK SOMETHING ...
2019-05-13 17:29:54    KAPLAN SAYS TARIFFS PUT SAND IN THE GEARS FOR ...
Name: text, dtype: object
2019-05-13 17:29:54   2019-05-13 17:29:54    KAPLAN SAYS THE BEST THING THE FED CAN DO ON R...
2019-05-13 17:29:54    FED'S KAPLAN SAYS I DON'T THINK WE SHOULD BE C...
2019-05-13 17:29:54    FED'S KAPLAN SAYS FOR NOW FED'S RATE SETTING I...
2019-05-13 17:29:54    KAPLAN SAYS TRADE RELATIONSHIPS, PARTICULARLY ...
2019-05-13 17:29:54    KAPLAN SAYS HE IS HOPEFUL WILL WORK SOMETHING ...
2019-05-13 17:29:54    KAPLAN SAYS TARIFFS PUT SAND IN THE GEARS FOR ...
Name: text, dtype: object
2019-05-13 17:29:54   2019-05-13 17:29:54    KAPLAN SAYS THE BEST THING THE FED CAN DO ON R...
2019-05-13 17:29:54    FED'S KAPLAN SAYS I DON'T THINK WE SHOULD BE C...
2019-05-13 17:29:54    FED'S KAPLAN SAYS FOR NOW FED'S RATE SETTING I...
2019-05-13 17:29:54    KAPLAN SAYS TRADE RELATIONSHIPS, PARTICULARLY ...
2019-05-13 17:29:54    KAPLAN SAYS HE IS HOPEFUL WILL WORK SOMETHING ...
2019-05-13 17:29:54    KAPLAN SAYS TARIFFS PUT SAND IN THE GEARS FOR ...
Name: text, dtype: object
2019-05-13 17:46:47.761000   Briefing.com: Stock Market Update - 13:30 ET
2019-05-13 17:29:54   2019-05-13 17:29:54    KAPLAN SAYS THE BEST THING THE FED CAN DO ON R...
2019-05-13 17:29:54    FED'S KAPLAN SAYS I DON'T THINK WE SHOULD BE C...
2019-05-13 17:29:54    FED'S KAPLAN SAYS FOR NOW FED'S RATE SETTING I...
2019-05-13 17:29:54    KAPLAN SAYS TRADE RELATIONSHIPS, PARTICULARLY ...
2019-05-13 17:29:54    KAPLAN SAYS HE IS HOPEFUL WILL WORK SOMETHING ...
2019-05-13 17:29:54    KAPLAN SAYS TARIFFS PUT SAND IN THE GEARS FOR ...
Name: text, dtype: object
2019-05-13 17:29:54   2019-05-13 17:29:54    KAPLAN SAYS THE BEST THING THE FED CAN DO ON R...
2019-05-13 17:29:54    FED'S KAPLAN SAYS I DON'T THINK WE SHOULD BE C...
2019-05-13 17:29:54    FED'S KAPLAN SAYS FOR NOW FED'S RATE SETTING I...
2019-05-13 17:29:54    KAPLAN SAYS TRADE RELATIONSHIPS, PARTICULARLY ...
2019-05-13 17:29:54    KAPLAN SAYS HE IS HOPEFUL WILL WORK SOMETHING ...
2019-05-13 17:29:54    KAPLAN SAYS TARIFFS PUT SAND IN THE GEARS FOR ...
Name: text, dtype: object

icon clock
10 |1500

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

Hi @Luke@MBBS

I did check that news item and it looks that it is kind of a story that is updated with new lines as they come.

You can check that the latest version of the story was created on 2019-05-13.

And this is how it looks in Eikon desktop

2.jpg (228.2 KiB)
1.jpg (57.1 KiB)
Upvotes
1 0 1 3

@marcin.bunkowski does this mean that a story can be created and get modified eventually? If this is the case, then I'll assume the index of the dataframe will be indexed by the last modified timestamp of the news?

icon clock
10 |1500

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

Upvotes
1 0 1 3

hi @marcin.bunkowski, also, there is a maximum of 100 new headlines we can retrieve?

icon clock
10 |1500

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

Hi @Luke@MBBS yes, you are right, the upper limit is 100. You may check this thread as well.

Upvotes
1 0 1 3

ok thanks very much @marcin.bunkowski, I'm good with the answer.

icon clock
10 |1500

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

Click below to post an Idea Post Idea