Need help to transform a code from CODEBK into a code using API without Eikon.

I am having problem with the parameter "CH", which is not supporter in the fundamental_and_reference.Definition. And there is nothing about it in the docummentation here
from refinitiv.data.content import fundamental_and_reference df_earnings_surprise= pd.DataFrame() definition= fundamental_and_reference.Definition(
universe= br_instruments,
fields=['TR.NetProfitPreSurprise.calcdate','TR.NetprofitSmartEst(Period=CY2025)'],
parameters= {
'SDate':'1',
'EDate':'-24',
'Frq': 'W',
'Curn': 'BRL', #'CH': 'IN;Fd' #Here is the problem, #'RH': 'date'
'Scale': 6
},
row_headers= 'date'
).get_data()
Answers
-
Hello @augusto_krappa
The fundamental_and_reference object of the Data Library - Content Layer is built on top of the RDP APIs DataGrid service.
I did a quick test on the RDP APIs Document, the DataGrid service does not support the "CH" parameters. That is why the fundamental_and_reference object does not support "CH" parameter too.
0 -
Hi @wasin.w . Yes i know it is not working. But what would be a solution for this?
I must substitute the sintaxe "CH":"IN;Fd" by what?0 -
Hi @augusto_krappa ,
Is this the result in the format you're looking for? If so, you can get the result in dataframe format by adding ".data.df"
0 -
Hi @raksina.samasiri, thanks for that. It is almost what i want. From codebk, i already have the code that returns it vertically stacked (due to the parameter "CD":"Fd")
I couldnt work around the dataframe to stack it vertically instead of horizontally. Could you help me on that please?0 -
You may need to use the Python code to reformat the dataframe. For example:
df1 = definition.data.df new_df = pd.DataFrame() objective_output_set = {item[0] for item in df1.columns} for ric in objective_output_set: df2 = df1[(ric)] df2.insert(loc=0, column='Instrument', value=ric) new_df = pd.concat([new_df, df2]) new_df
2 -
Hello @augusto_krappa
If you need the DataGrid service to support the "CH" parameter syntax and feature, you can raise an enhancement request to the support team directly via https://myaccount.lseg.com/en/productsupport website.
0 -
@Jirapongse thank you!
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
- 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 中文论坛