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
- 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 中文论坛