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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 1 5

How can I get news in real-time in Python?

I am currently working on a project that requires me to collect news articles in Python under certain filters in real-time. I am doing this using the get_news_headlines() function and it works well. The only issue is that once I tried to run the code over an interval of 10 minutes, it did not collect any news. After further testing, I realized that news published within the previous 2 hours from the current time cannot be collected. For example, when I run the program at 8am, I can only collect data on news that were published at 6am or before.

Could someone help me with this issue please?

eikoneikon-data-apipythonworkspaceworkspace-data-apirefinitiv-dataplatform-eikonnews
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

Upvotes
Accepted
39.3k 76 11 27

@azzopardic

I do not reproduce the issue you describe on my end. Are you sure you're not misinterpreting news headlines timestamps returned by get_news_headlines method? The timestamps are returned in GMT, not in your local time zone.

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.

I did not know they were returned in GMT, and given I am in CET, it does make sense. Thank you so much.