question

Upvotes
Accepted
11 1 4 7

Websocket for /data/news/beta1/headlines

I can now call the endpoint for /data/news/beta1/headlines from my python code. In order to make it real-time, do I need other credentials or any other things to use a web socket for this endpoint?

I tried my credentials on the Python Elektron Real-Time Examples https://github.com/Refinitiv/websocket-api/tree/master/Applications/Examples/EDP/python but it didn't work. I'm quite confused about what I need in order to use web socket for news to make it Real-Time, not to only get news whenever I call the endpoint.

rdp-apirefinitiv-data-platformwebsockets
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
21.8k 57 14 21

@hsss:

>> 2. The 6th part for close open subscription in the tutorial says that: "EDP will continue to push events into the queue, which will automatically expire after 24 hours if not processed." Can I know how should I process so that EDP won't expire after 24 hour?

The Part 4 of tutorial explains how to poll and remove the messages from the queue. Its is the message already pushed into the queue which expire (if not removed), and not the EDP itself.

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
21.8k 57 14 21

Hi @hsss, The /data/news/beta1/headlines is a REST endpoint and does not offer streaming data. You can invoke it periodically to get the latest headlines, but not connect to it using websockets.

If the interest is in getting streaming news, then the News Alerts service is better suited for the purpose. Please follow this tutorial on using the alerts for news.

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.

Thanks for the reply!

I have two questions left after following the tutorial.

1.For the subject code for alert registration, can I put words like "Financials" or some random words that I want to search on in there?

2. The 6th part for close open subscription in the tutorial says that: "EDP will continue to push events into the queue, which will automatically expire after 24 hours if not processed." Can I know how should I process so that EDP won't expire after 24 hour?

Thanks!

Hello @hsss

Regarding the first question, you can find more detail about the "Filter" attribute and supported query in the following sections of News API User and Design Guide document.

  • section 2.2 NEWS Coding
  • section 3.6.1.2.Create Alert Subscription

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.