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
84 4 2 5

get_news_headline returning only 10 news items, any restrictions?

Hi,

Is there a restriction on the number of news items we can retrieve using Python Eikon get_news_headlines API function. I seem to only be retrieving 10 items, even though the date_from and date_to arguments are from 2000 to 2019.

Appreciate your help.

Regards

Leben

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.

Upvotes
Accepted
24.4k 53 17 14

Hello @lebenjohnson.mannariat

Based on the Eikon Data APIs for Python - Reference Guide, the you can set number of news items via the count value in get_news_headlines() .


capture.png (57.1 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.

Upvotes
7.6k 15 6 9

@lebenjohnson.mannariat

Please add count(max is 100) to the get_news_headlines method.

import eikon as ek
ek.set_app_key('You App Key')
try:
    headlines = ek.get_news_headlines("NRG", count=20, raw_output=False)
    print(headlines['text'])
except ek.EikonError as error:
    print(error)


capture.jpg (178.5 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.

Upvotes
84 4 2 5

Thanks much appreciated. However the max count limit of 100 is very small, as for any topic you would end up getting more hits in a year. Is there any way to increase it?

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
39.4k 77 11 27

@lebenjohnson.mannariat
You cannot retrieve more than 100 headlines in a single request using this interface. You can however submit multiple requests and retrieve news headlines in batches of 100 headlines each in a loop using the timestamp on the earliest headline returned in the previous batch as a value for date_to parameter in the next request.
Eikon is an end user product. Any data retrieved from Eikon is licensed for individual user's use only. You should also be aware that the depth of news history available through Eikon Data APIs is 15 months. You cannot retrieve news headlines or stories older than 15 months using Eikon Data APIs. If you need deeper history or need to consume news on an industrial scale, consider Refinitiv Machine Readable News proposition.

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
84 4 2 5

Thanks Alex,

Much appreciated. I was needing the news for some individual research.

Regards

Leben

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.