question

Upvotes
Accepted

Fetch all news for a given day via data/news/ API

I need to fetch all the news headlines and stories for a given day via data/news/v1 API.

Since there's no such endpoint which can provide daily dump of news data, what I did was to first get all the headlines using headlines?dateFrom=....&dateTo=... endpoint (using next cursor) then iterate over the headlines to get the storyId, then for each storyId query the stories/{storyId} endpoint to fetch the story for that given storyId.

Now for a given day usually there are more than 15K news stories.

My single-threaded program takes forever to fetch these many stories (not counting the issues with token refresh/expiration).

If I use multiprocessing I get below exception

Code 429, 'Too Many Requests' for data/news/v1/stories/{storyId}

Could you please let me know what is the most efficient way to fetch all the news (headlines + stories) for a given day?

Would it be possible for you to provide this data via SFTP instead?

Note: We are already using the streaming news service of Refinitiv but we also want the data via data/news/ API for reconciliation purposes.

pythonrdp-apipython apinewsrdprefinitiv-dataplatform-libraries
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
76.6k 238 52 72

@chandra.prakash.pathak

The /data/news/v1/ endpoint allows users to access news stories via the /data/news/v1/stories/{storyId} endpoint and it requires a story Id to get a news story. Therefore, it means that you will get a story per request.

You may need to find other products that can provide news. For example, I found this Retrieving News Items with the DSS (DataScope Select) REST API article that shows how to retrieve news stories within the requested range.

Otherwise, you need to contact your Refinitiv Account team or Sales team directly to discuss and find other solutions that suit your requirements.

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
5.3k 21 2 4

Hi @chandra.prakash.pathak, I believe a bulk way to fetch news is described in this article, 'News Sentiments - Gleaning Insights'; does it have the answer you're after?

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 read the article, I don't think it helps me with my use-case.
Could you please share a small example to fetch news (headlines+stories) for a given day that doesn't take hours?

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.