In News Monitor I see that US FDA is tagged as "P:[U S Food and Drug Administration]". I'm trying to use this value into the query parameter of ek.get_news_headlines() but it doesn't seem to work. Any suggestions?
@daniele.colombo21
You can try 'P:[U S Food and Drug Administration]', as shown below.
df = ek.get_news_headlines('P:[U S Food and Drug Administration]')
The output is:
Currently, the get_news_headlines method can only get headlines from the News Wires source.
If you would like to add double quotes to a query, you need to use the '\' characters, as shown below.
news = ek.get_news_headlines('R:.SPX AND \\"TRUMP\\"')
Hi @daniele.colombo21
It will be helpful if you provide a screenshot of the News Monitor and what you are querying and an example of the get_news_headlines() API call you are using.
Thank you for your help. See below screenshot of News Monitor:
And another one when I click to expand the topic:
Finally an example query (I've tried various flavours though, with and without double quote escapes, square brackets, etc):
ek.get_news_headlines(query='""P:[U S Food and Drug Administration]""', count=10)
Which returns error
If you use the strategic API (Refinitiv Data Library for Python), you can optionally access additional news sources. For example:
import refinitiv.data as rdfrom refinitiv.data import eikon as ek...# Default Source: News Wireek.get_news_headlines(query='P:[U S Food and Drug Administration]')# News Room Sourceek.get_news_headlines(query='P:[U S Food and Drug Administration]', repository='NewsRoom')# Web News Sourceek.get_news_headlines(query='P:[U S Food and Drug Administration]', repository='WebNews')