lseg python API

What is the best and easiest way to create a single dataframe with time series of NAV of funds and close of equities or indexes using a lseg formula such as get_data or get_history ? i can't easily have both in the same dataframe.
thks
Answers
-
Thank you for reaching out to us.
You can use the get_history method in the LSEG Data Library for Pyton to retrieve historical data. For example:
df = ld.get_history(universe=["CRUD.L"], fields=["TR.FundNav","TR.PriceClose"], start="2024-11-01", end="2024-12-03") df
The output is:
The examples are on GitHub. You can use the Data Item Browser tool to search for other fields.
0 -
Thank you very much. This is helpful ! How can I do in the case I want to add the following rics to get in the same dataframe the times series : EUR= ; US10YT=RR ?
0 -
The universe parameter accepts an array of items. For example:
universe=["EUR=","US10YT=RR","IBM.N"]
The fields parameter accepts an arry of fields. For example:
fields=["TR.FundNav","TR.PriceClose"]
You can add other RICs in the universe parameter and add other fields in the fields parameters.
0 -
However It returns an error message :
LDError: Backend error. 400 Bad Request Requested universes: ['.SXAP', '.SX7P', 'EUR=', 'US10YT=RR']. Requested fields: ['TR.FUNDNAV', 'TR.PRICECLOSE'].
And if I try to get only EUR= and US10YT=RR and US2YT=RR the error message is the following :
LDError: Unable to collect data for the field 'TR.FundNAV' and some specific identifier(s). Requested universes: ['EUR=', 'US10YT=RR', 'US2YT=RR']. Requested fields: ['TR.FUNDNAV', 'TR.PRICECLOSE']
Everything works well as long as I don't try to get EUR= or US10YT=RR
It sounds like I should use another field, but which one ?
0 -
I got this data.
The error is:
[{"code":416,"col":2,"message":"Unable to collect data for the field 'TR.FundNAV' and some specific identifier(s).","row":0},
You can use the Data Item Browser tool to search fields.
Otherwise, you can contact the helpdesk support team via MyAccount and ask for fields that can provide the required data.
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
- 614 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
- 248 ETA
- 552 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
- 640 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
- 191 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 中文论坛