Content Types for NEWS API

Hi, i'm trying to pull news headlines via the workspace API.

rd.news.get_headlines("LSEG, MSFT.O AND Language:LEN", count=50)

this code works for pulling headlines, but how do i add another filter for "content type" like in the APP NEWS 2.0? i.e. web news, research, transcripts, filings etc.

I'd like to filter my query. I tried "ContentType", but that didn't yield any results. Please advise. I tried it with adding sources, and i know that works but do we have something for content types etc.?


I have checked with our News Service Specialist and they advised to raise this query here (DevPortal) instead as they only cater issues related to News content and apps as Desktop API is out of their scope.

Can you please confirm if this is a product limitation in terms of API usage unlike in our NEWS2.0 app.

image.png

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @RogelynMayAgustin

    Thank you for reaching out to us.

    The get_headlines method is a raw interface used to retrieve news headlines by a news query.

    As far as I know, there are a lot of news codes that can be used in news queries.

    To answer this question, I need to know if there are any news codes for content types. For example, I found the "Meta:WebNews" which can be used to get WebNews. For example:

    response = news.headlines.Definition("AAPL.O and LEN and Meta:WebNews", count=100).get_data()
    response.data.df
    
    image.png

    We need to check if we have other news codes for other content types.

    If the helpdesk doesn't know the answer, please escalate this issue to the upper level.