New posts are disabled while we improve the user experience.

You can browse the site, or for urgent issues, raise a query at MyAccount.

question

Upvotes
Accepted
1 0 0 3

get_news_headlines API return significantly less data compared to terminal on the same query

I am using python eikon data api's get_news_headlines function.


As you can see, with the following query, I am able to see up to date news headlines in the terminal. However,the api onlu returns a few stale articles. Can you please check what is the issue for this, and how can I pull the exact same results as shown in terminal?

"R:NSC.N AND Topic:ESG NOT ( Topic:REP OR Topic:RES OR \\\"class action\\\" OR \\\"alert\\\" OR \\\"reminder\\\" OR \\\"notice\\\" ) AND Source:SUGG AND Language:LEN"

Thanks in advance.

news-data-api.pngnews-terminal.jpg

python#product#contentpython apinews
news-data-api.png (65.3 KiB)
news-terminal.jpg (495.9 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.

1 Answer

· Write an Answer
Upvote
Accepted
87.8k 294 53 79

@DC

Thanks for reaching out to us.

I can run it properly.

q="R:NSC.N AND Topic:ESG NOT ( Topic:REP OR Topic:RES OR \\\"class action\\\" OR \\\"alert\\\" OR \\\"reminder\\\" OR \\\"notice\\\" ) AND Source:SUGG AND Language:LEN"
headlines = ek.get_news_headlines(q,count=100, date_from="2023-01-01")
headlines

The output is:

1676529368515.png

The Eikon Data API can retrieve data from the news wire source.

1676529455691.png

To get new headlines from other sources, you need to use the Refinitiv Data Library. There is an Eikon Data API in the Refinitiv Data Library. Please see the example on GitHub.

The code looks like this:

q="R:NSC.N AND Topic:ESG NOT ( Topic:REP OR Topic:RES OR 'class action' OR 'alert' OR 'reminder' OR 'notice' ) AND Source:SUGG AND Language:LEN"
ek.get_news_headlines(query = q, repository='WebNews,NewsRoom,NewsWire', count=100, date_from='2023-01-01')

I hope that this information is of help.


1676529368515.png (71.2 KiB)
1676529455691.png (142.6 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.

Thank you! The api seemed to be misbehaving when I last accessed it. It works for me now as well.

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.