How to get NEWS for Sugar
Hi @beebijankammar_1, Thanks for your question. You can refer this article LSEG Data Library - Patterns and Features - Vol. 2: Asking What You Mean which covers how to filter news headlines as per need. You can also refer our developers.lseg.com portal for many news related articles. Please let me know if this helps. Thanks : )
do we have anything related to sugar
@beebijankammar_1: Yes. Please refer to the TOPICS app on LSEG Workspace which has topic codes for news on various categories and the article I shared. A basic code can look like this with topic code SUG for sugars:
TOPICS
import lseg.data as ld ld.close_session() ld.open_session() from datetime import datetime, timedelta # Defining end as today, start as ~6 months back (182 days ≈ 2 quarters) end_date = datetime.today() start_date = end_date - timedelta(days=182) ld.news.get_headlines( query='topic:[SUG] AND Language:LEN', count=350, # default is 10 if not mentioned start=start_date.strftime('%Y-%m-%d'), end=end_date.strftime('%Y-%m-%d') )
For more clarification on the Topic codes, please reach out to LSEG Support as this then becomes a content related question and out of our scope as the moderators of this forum are API technical experts. Thanks.