Replicating the related rics column in the news view using python

I'm looking to get the data from the related rics column as seen in the news monitor through python.
I can download news articles similar to the news monitor however this is missing the related rics column. I am using this code,
response = news.headlines.Definition("7974.T", count=150).get_data()
how would I add the column to the downloaded data
Answers
-
Thank you for reaching out to us.
You can get RICs from the response.data.raw. A RIC is in the _qcode property with the "R:" prefix.
0 -
The code could be like this:
import pandas as pd response = news.headlines.Definition("7974.T", count=150).get_data() data_array = [] for story in response.data.raw[0]['data']: rics = [] for code in story['newsItem']['contentMeta']['subject']: if code['_qcode'].startswith('R:'): rics.append(code['_qcode'].split(':')[1]) data_array.append( { 'StoryId': story['storyId'], 'Headline': story['newsItem']['itemMeta']['title'][0]['$'], 'FirstCreated': story['newsItem']['itemMeta']['firstCreated']['$'], 'VersionCreated':story['newsItem']['itemMeta']['versionCreated']['$'], 'RIC': ' '.join(rics), 'SourceCode': story['newsItem']['contentMeta']['creator'][0]['_qcode'] }) df = pd.DataFrame(data_array) df
0 -
Thanks, that's super clear.
Is there any documentation about what each of the different letters mean in the raw data i.e. r for ric, m for ?
That is the is there any documentation for interpreting what the individual _qcode means?
0 -
Hi @Xim_O ,
For the meaning of each qcode, you can use News Monitor 2.0 application in LSEG Workspace. To access the app, simply type NEWS2.0 in the Workspace search bar.
Then in the search bar of News Monitor, you can put the qcode there and then press enter button, the meaning of the qcode input will be shown.
You can also check article Exploring News Metadata - with Refinitiv Data Platform and Python
1 -
There are news codes that can be used in news queries. You can refer to this document.
Otherwise, please contact the helpdesk team directly via LSEG support for their meanings. Please include the URL of this discussion in your raised question to prevent it from being redirected back to this Q&A forum.
1
Categories
- All Categories
- 3 Polls
- 6 AHS
- 37 Alpha
- 167 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 705 Datastream
- 1.5K DSS
- 633 Eikon COM
- 5.2K Eikon Data APIs
- 14 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 6 Trading API
- 3K Elektron
- 1.5K EMA
- 259 ETA
- 569 WebSocket API
- 40 FX Venues
- 16 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 25 Messenger Bot
- 4 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 284 Open PermID
- 47 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 24 RDMS
- 2.2K Refinitiv Data Platform
- 879 Refinitiv Data Platform Libraries
- 5 LSEG Due Diligence
- 1 LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 123 Open DACS
- 1.1K RFA
- 108 UPA
- 196 TREP Infrastructure
- 232 TRKD
- 919 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 103 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛