Get_news - count of news articles for a RIC, date range and topic

Hi,

As above title please, looking to run a count of news articles for a particular RIC, date range and ‘topic’. I.e. TSLA.O, 6th November 2023 - 10 November 2023, topic=SIGDEV.

I’d like a count of news articles per day.

Is this possible?

I’m aware of how to run get news story for the above, but it’s time consuming. I’d just like to run a count of news articles or headlines - that meet the above criteria - per each day within the specified date range.


Thank you

Best Answer

  • [Deleted User]
    [Deleted User] Newcomer
    Answer ✓

    Hi @di.ti,


    I believe it might be best to use the RD Lib. for Python's functionanity called 'Delivery' in the following way:

    import refinitiv.data as rd
    try: # The following libraries are not available in Codebook, thus this try loop
    rd.open_session(
    config_name="C:\\Example.DataLibrary.Python-main\\Configuration\\refinitiv-data.config.json", # this is where my config file is located
    name="desktop.workspace") # rdp.platform
    except:
    rd.open_session()

    company = "TSLA.O"
    start = "2023-11-06"
    end = "2023-11-10"
    source = "SIGDEV"

    request_definition = rd.delivery.endpoint_request.Definition(
    url=f"https://api.refinitiv.com/data/news/v1/headlines?query={company} and {source} daterange:"{start},{end}"",
    method = rd.delivery.endpoint_request.RequestMethod.GET)
    response = request_definition.get_data()
    response.data.raw['meta']['count']

    1699880332506.png


    Does this meet your need?

    N.B.: You can find info abou this endpoint (which is named a `url` above) here; e.g.: "Limit of headline (default 10, range value: [0, 100])"

Answers