Need Help Retrieving Financial Metrics with Refinitiv API

Hello,
I am working on a project where I need to complete an Excel table containing information on M&A deals. I am using the Refinitiv API to retrieve the missing financial metrics for the acquirers, specifically:
- EBITDA Margin for the year of the deal (N) and two years after (N+2)
- Pre-tax ROE for the year of the deal (N) and two years after (N+2)
- Pre-tax ROA for the year of the deal (N) and two years after (N+2)
Here are some details about my setup and what I have tried so far:
Environment Setup:
- I am using Python with the
pandas
andrefinitiv.data
libraries. - I have configured the environment variable
RD_LIB_CONFIG_PATH
to point to my configuration file.
- I am using Python with the
Reading Information from the Excel Table:
- I have successfully read the basic information from the table, including the acquirer name and the deal year.
Issues Encountered:
- I have tried several methods to retrieve the financial metrics (e.g.,
rd.content.equities.get_metrics
,rd.metrics.get
, andrd.content.pricing.get_history
), but they do not seem to be available or do not work. - Common errors include missing attributes or methods not found.
Example Code
Here is an example of the code I used to attempt to retrieve the data:
- I have tried several methods to retrieve the financial metrics (e.g.,
import os
import pandas as pd
import refinitiv.data as rd
# Configure the environment variable
os.environ["RD_LIB_CONFIG_PATH"] = "../Configuration"
# Load the Excel file
file_path = r'C:\Users\jean-\Desktop\Memoire\Test.xlsx'
df = pd.read_excel(file_path)
# Extract the first observation for the test
first_observation = df.iloc[0]
acquiror_name = first_observation['Acquiror Full Name']
deal_date = first_observation['Date Announced']
deal_year = deal_date.year
print(f"Acquiror: {acquiror_name}, Deal Year: {deal_year}")
# Open the session
rd.open_session(name='platform.rdp')
print("Session opened successfully.")
try:
# Example attempt to retrieve financial metrics
ebitda_margin_n_response = rd.metrics.get(
universe=[acquiror_name],
fields=['TR.F.EBITDAMARGPCT'],
parameters={'SDate': f'{deal_year}-12-31', 'EDate': f'{deal_year}-12-31'}
)
ebitda_margin_n = ebitda_margin_n_response.data.df['TR.F.EBITDAMARGPCT'].iloc[0] if ebitda_margin_n_response.is_success else None
print(f"EBITDA margin N: {ebitda_margin_n}")
except Exception as e:
print(f"Failed to retrieve data for {acquiror_name}: ", str(e))
# Close the session
rd.close_session()
print("Session closed successfully.")
Request for Help
I am looking for help to:
- Identify the correct methods and attributes to retrieve the necessary financial metrics (EBITDA Margin, Pre-tax ROE, Pre-tax ROA).
- Provide a functional code example to retrieve these data for a given company and a specific year.
Thank you in advance for your assistance!
Best Answer
-
as a reference, here's the solution provided in the raised ticket
• The EBITDA Margin (from the screenshot) comes from the "Financials" tab of a company's Overview page. This means that the data item that was used comes from the Financials category data set.
• This also means that if you're looking for these type of financial metrics from deals in our M&A deals database, Financials-category data items are not going to work as these are mainly used for periodically company-reported financials statements like balance sheets, etc.
• If you really are looking for M&A deals-related financials, you may find the correct data items under the "Deals" > "Financials" category (as seen on the screenshot below). Please note that the availability of M&A-related financial metrics still depend on whether the parties disclose these data on the deal. Also, our M&A database doesn't track post-deal data so "N+2" or "two years after" deal-related financial metrics will not be available in the M&A data set.
• Otherwise, if you are just looking for Financials which are not M&A deals-related, then we can use the "Financials" category data items. Please note that referencing or using the Acquiror name for financials-category data items will not work as they are from different data sets.0
Answers
-
Hi @jean.lemaire ,
The moderators
on this forum are expertise on Refinitiv APIs usage. However, they do not have
deep expertise in every type of content available through Refinitiv products.
Such expertise is available through Refinitiv Helpdesk, which can be reached
via MyRefinitiv. To be of help, ticket number 13636251 was raised on your
behalf and the support team is going to contact you soon to assist with this.Hope this helps
and please let me know in case you have any further questions0
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
- 685 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
- 252 ETA
- 556 WebSocket API
- 38 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
- 652 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
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 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 中文论坛