Pulling snippet date VCHAIN data LSEG Workspace via Refinitiv API

I have question about the LSEG Workspace value chains data (VCHAIN). For some time we've been pulling the VCHAIN data via the Refinitiv API.
This works like a charm for the following fields: TR.SCRelationship', 'TR.SCRelationship.ScorgIDOut', 'TR.SCRelationship.instrument', 'TR.SCRelationshipConfidenceScore', 'TR.SCRelationshipFreshnessScore', 'TR.SCRelationshipUpdateDate'.
We use this Python code:
value_chains = dl.get_data(
universe=inputList,
fields=['TR.SCRelationship', 'TR.SCRelationship.ScorgIDOut',
'TR.SCRelationship.instrument', 'TR.SCRelationshipConfidenceScore', 'TR.SCRelationshipFreshnessScore','TR.SCRelationshipUpdateDate']
)
However, we also want to pull the data of the news snippets (not the snippets themselves, only the dates) available in the Workspace. See screenshots below for how to find them in the Workspace. We'd like to do this via the API because we work with a big dataset of companies, but we cannot find a field code to do so. Is this possible via the API?
Best regards, Maarten Gubbels
Data Librarian for the Nijmegen School of Management, Radboud University Nijmegen (Netherlands)
snippet date, the fiels we'd like to pull
Where to find this date in the LSEG Workspace (VCHAIN app):
Answers
-
@MaartenG Thanks for your question - so the snippet count is defined as the following:
Snippet evidence text is the sentence extracted from the source document (e.g. News, Filings) that provides evidence signaling the supplier-customer relationship. The Snippet Count is the total number of de-duplicated evidence texts collected from all the source documents for the supplier-customer relationship pair.
This number is calculated from news query as well as filing queries - it is not delivered via API. So the Filings are not available via API in Eikon/Workspace - so you will not be able to replicate this. However, you could try to do a News Search for both the supplier and customer pair and try to de-duplicate the articles and then count them. Something like the following will get the news headlines:
Now = datetime.now().date()
maxenddate = dNow - timedelta(days=365) #upto months=15
compNews = pd.DataFrame()
for ric in riclist:
try:
cHeadlines = rd.news.get_headlines("R:VOD.L AND R:BRTI.NS AND LANGUAGE:LEN", start= str(dNow),end = str(maxenddate), count = 10000)
#cHeadlines['cRIC'] = ric
if len(compNews):
compNews = pd.concat([compNews,cHeadlines])
else:
compNews = cHeadlines
except Exception:
pass
compNewsThen you would need to de-duplicate the headline (maybe if headline and source are similar/same) and then count. This would not be as sophisticated as say getting the story and looking for sentences where both are mentioned - it might be possible to to that by requesting a story and then searching for both names in the same sentence - a relatively straightforward task for a vectordb - though you would need to get each story for each headline and then create embeddings / tokenise for each sentence say.
Another approach could be to use the news metadata component to actually check the News Codes that were applied to each news headline. This can be done using :
baseurl = "/data/news/v1/stories/"
fullcodelist = pd.DataFrame()
compNews['storyText'] = str()
compNews['q_codes'] = str()
compNews['pIDs_mentioned'] = str()
compNews['RICs_mentioned'] = str()
compNews['urgency'] = str()
for i, uri in enumerate(compNews['storyId']):
request_definition = rd.delivery.endpoint_request.Definition(
url = baseurl + uri,
method = rd.delivery.endpoint_request.RequestMethod.GET
)
response = request_definition.get_data()
time.sleep(0.1)
rawr = response.data.raw
if 'newsItem' in rawr.keys():
compNews['storyText'][i] = rawr['newsItem']['contentSet']['inlineData']['$']
topics = rawr['newsItem']['contentMeta']['subject']
rics = [x for x in rawr['newsItem']['assert'] if x['_qcode'].startswith("R:")]
compNews['q_codes'][i] = [d['_qcode'] for d in topics]
compNews['pIDs_mentioned'][i] = [x for x in compNews['q_codes'][i] if x.startswith("P:")]
compNews['RICs_mentioned'][i] = [d['_qcode'] for d in rics]
compNews['urgency'] = rawr['newsItem']['contentMeta']['urgency']['$'] # 1 = hot, 3 = regular
compNewsHere you can see the Column RICs_mentioned - you could try counting articles where only the two RICs of interest are mentioned - ignoring articles where more RICs are mentioned as these are more likely to be sector general articles possibly. I hope this can help.
0 -
Dear @jason.ramchandani01 ,
Thanks so much for this elaborate answer. I'll share it with our researchers, and we'll see if we can make this work.
Best regards,
Maarten
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 249 ETA
- 554 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 643 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- 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
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 192 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛