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
39 2 4 6

Possible to get BY_LINE and DATE_LINE for news stories?

Hi,

I'm hoping to create a dataframe of news stories that includes bylines and datelines for each story. In the Eikon Data Item Browser, I can see BY_LINE and DATE_LINE. Is there a way I can query by those and have them show in a dataframe like the one below?

df = ek.get_news_headlines('Topic:US AND Language:LEN', date_to = "2020-11-04", count=100)

Thank you!

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apinews
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.

1 Answer

· Write an Answer
Upvotes
Accepted
78.1k 246 52 72

@noel.randewich

The Eikon Data Item Browser is used to find available fields for the get_data method. It doesn't apply to the get_news_headlines method.

The following is the raw data retrieved by calling the get_news_headlines method.

 [{'displayDirection': 'LeftToRight',
   'documentType': 'Story',
   'firstCreated': '2020-11-04T00:00:00.000Z',
   'isAlert': True,
   'language': 'L:en',
   'reportCode': '',
   'sourceCode': 'NS:RTRS',
   'sourceName': 'Reuters News',
   'storyId': 'urn:newsml:reuters.com:20201104:nN9N2GS003:1',
   'text': 'TRUMP PROJECTED WINNER IN INDIANA (11 ELECTORAL VOTES) – EDISON RESEARCH',
   'versionCreated': '2020-11-04T00:00:00.000Z'},
  {'displayDirection': 'LeftToRight',
   'documentType': 'Story',
   'firstCreated': '2020-11-03T23:59:54.342Z',
   'isAlert': False,
   'language': 'L:en',
   'reportCode': '',
   'sourceCode': 'NS:DJN',
   'sourceName': 'Dow Jones News',
   'storyId': 'urn:newsml:reuters.com:20201103:nDJR6sSL5T:1',
   'text': 'DJ CFO Sial Registers 48,161 Of SunPower Corp >SPWR',
   'versionCreated': '2020-11-03T23:59:54.342Z'},
  {'displayDirection': 'LeftToRight',
   'documentType': 'Story',
   'firstCreated': '2020-11-03T23:59:44.335Z',
   'isAlert': False,
   'language': 'L:en',
   'reportCode': '',
   'sourceCode': 'NS:DJN',
   'sourceName': 'Dow Jones News',
   'storyId': 'urn:newsml:reuters.com:20201103:nDJR3wJMHS:1',
   'text': 'DJ CEO Douglas Jr Registers 3,000 Of Computer Programs & Systems Inc >CPSI',
   'versionCreated': '2020-11-03T23:59:44.335Z'},

It doesn't contain BY_LINE and DATE_LINE fields.


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.