python sample code for rdp api fetching news analytics
Hi team, where can i find sample python code to fetch news analytics from RDP using rdp api? I'm also confused about the python library since we have refinitiv.dataplatform, refinitiv.data and refinitiv.data-platform, which is the correct one for rdp api? And do we have detailed tutorial regarding the fileds for all commands? Thank you.
Best Answer
-
Hello @Julian.Bai
There is the /data/news/v1/analyze endpoint in the RDP APIs. Is it what the client wants?
You can find more detail on the RDP API Playground (/data/news/v1/analyze operation) reference and the RDP APIs News User Guide pages.
The recommend ease-of-use API for RDP is the Refinitiv Data Library for Python. There is no news analyze interface, but the client can use the Endpoint interface examples as a reference.
The client can find more detail about the RD Library for Python on the following resources:
- Quickstart: https://developers.refinitiv.com/en/api-catalog/refinitiv-data-platform/refinitiv-data-library-for-python/quick-start
- Document: https://developers.refinitiv.com/en/api-catalog/refinitiv-data-platform/refinitiv-data-library-for-python/documentation
- Examples and Tutorials: https://github.com/Refinitiv-API-Samples/Example.DataLibrary.Python
Note: Please note that if the client needs "MRN News Analytics", the MRN (Machine Readable News) is available on Refinitiv Real-Time only. The recommended one is the EMA Java API;
- EMA Java API MRN Tutorial
- Introduction to Machine Readable News (MRN) with Enterprise Message API (EMA)
0
Answers
-
Hello @Julian.Bai
Thank you for reaching out to us. Firstly, please let me clarify the RDP APIs questions as follow:
- The Refinitiv Data Platform APIs (RDP APIs) are the core web-based APIs that provide Refinitiv content via the Request-Response (RESTful web service), Alert, Bulk, and Streaming delivery methods
- The Refinitiv Data Libraries (RD Library)are ease-of-use libraries that simplified RDP APIs via high-level API interfaces. It is the strategic library and is available for Python (Production ready), TypeScript (beta phase), and .Net (beta phase)languages
- The refinitiv.data-platform library is the non-strategic RDP ease-of-use library. It has been replaced by RD Library above
The recommended APIs are the core RDP APIs or RD Library based on your preference whether you need a manual HTTP operation/management or the ease-of-use API.
About the MRN News Analytics, I cannot find the related News Analytics endpoints on the https://apidocs.refinitiv.com/Apps/ApiDocs (RDP APIs document) page.
There is the Exploring News Metadata - with Refinitiv Data Platform and Python article about getting RDP News's metadata, I am not sure it is the thing you want.
The News Analytics is available on the Refinitiv Real-Time platform. There is the Refinitiv Real-Time WebSocket API Python example/article on How to get MRN News Analytics Data via WebSocket API page.
I hope this information helps.
1 -
Hi Wasin, thanks for the info. My client is just single user so which one is more easier and requires less dev work? Thank you.
0 -
Hi Wasin, let me check and may reply you later. Thank you!0
-
When seeking assignment writing assistance in the UK, it is crucial to select the best assignment writers who can deliver high-quality work and meet your academic requirements. With numerous services available, choosing the right one can be a daunting task. This article provides a guide to help you make an informed decision when selecting the write my assignment in the UK. We will explore key factors to consider, ensuring you receive exceptional service and top-notch assignments.
0 -
import requests
# Set up API credentials and endpoint
api_key = 'YOUR_API_KEY'
api_secret = 'YOUR_API_SECRET'
api_endpoint = '
# Set up request headers with authentication
headers = {
'Content-Type': 'application/json',
'X-api-key': api_key,
'X-api-secret': api_secret
}
# Set up request parameters
params = {
'query': 'YOUR_SEARCH_QUERY',
'count': 10 # Number of news analytics results to retrieve
}
# Send GET request to the API endpoint
response = requests.get(api_endpoint, headers=headers, params=params)
# Check if the request was successful (status code 200)
if response.status_code == 200:
# Parse the JSON response
data = response.json()
# Process the retrieved news analytics data
for result in data['data']:
# Access and print relevant information
title = result['title']
sentiment = result['sentiment']
relevance = result['relevance']
print(f"Title: {title}")
print(f"Sentiment: {sentiment}")
print(f"Relevance: {relevance}")
print("----------------------")
else:
print(f"Error: {response.status_code} - {response.text}")
Remember to replace
'YOUR_API_KEY'
,'YOUR_API_SECRET'
, and'YOUR_SEARCH_QUERY'
with your actual RDP API credentials and the desired search query for news analytics. This code sends a GET request to the RDP API endpoint, retrieves the news analytics data, and prints the title, sentiment, and relevance of each news result to the website development solution.0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛