LSEG api get_history doesnt have CLOSE

I’m migrating from eikon to lseg. I’ve been advised to migrate eikons get_timeseries to lseg get_history.
With eikon I can get the CLOSE values (see below in a.).
Lseg doesn’t have CLOSE or anything similar. (see below in b.)
This is using your own codebook.
Please advise.
a. Refinitiv.Eikon
df_hist_ek = ek.get_timeseries(
["CAD="],
start_date='2025-03-18',
end_date='2025-03-24',
interval='daily'
)
df_hist_ek
CAD= | CLOSE | HIGH | LOW | OPEN | COUNT |
---|---|---|---|---|---|
Date | |||||
2025-03-18 | 1.4299 | 1.4319 | 1.4267 | 1.4287 | 57761 |
2025-03-19 | 1.4324 | 1.4349 | 1.4293 | 1.4298 | 56450 |
2025-03-20 | 1.4323 | 1.4401 | 1.4311 | 1.4325 | 55030 |
2025-03-21 | 1.4349 | 1.4373 | 1.4311 | 1.4325 | 51312 |
2025-03-24 | 1.4318 | 1.4358 | 1.4287 | 1.4349 | 51661 |
b. Lseg-data
df_hist_ld=ld.get_history(
universe=["CAD="],
interval='daily',
start='2025-03-18',
end='2025-03-24'
)
df_hist_ld
CAD= | BID | ASK | BID_HIGH_1 | BID_LOW_1 | OPEN_BID | MID_PRICE | NUM_BIDS | ASK_LOW_1 | ASK_HIGH_1 | ASIAOP_BID | ... | ASIACL_BID | EUROP_BID | EURHI_BID | EURLO_BID | EURCL_BID | AMEROP_BID | AMERHI_BID | AMERLO_BID | AMERCL_BID | OPEN_ASK |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Date | |||||||||||||||||||||
2025-03-19 | 1.4324 | 1.4329 | 1.4349 | 1.4293 | 1.4298 | 1.43265 | 56450 | 1.4296 | 1.4352 | 1.4298 | ... | 1.4326 | 1.4309 | 1.4337 | 1.4305 | 1.433 | 1.4328 | 1.4349 | 1.4306 | 1.4324 | 1.4303 |
Best Answer
-
Hi @valstar
The new historical pricing service does not map to the exact same fields as the older APIs had limited fields and generally created a consolidated view independent of the type of asset. In the case of "CAD=", the field list will be more specific (and accurate) based on the actual type of asset (currency). So, for currencies, the actual accurate fields names will be different than that of an equity.
So, to create an equivalent, try this:
You will see this matches the ek.get_timeseries() call result.
2
Answers
-
Hi @valstar ,
I would advise using the
fields
argument of the get_history function. you can find more information about it here:
https://developers.lseg.com/en/api-catalog/lseg-data-platform/lseg-data-library-for-python/tutorials#tutorial-4-get_history0 -
Hello Jonathan and Nick,
Thanks for the answers.
Regarding Jonathan's response: I omitted the fields parameter in the get_history call because it fails when I include fields="CLOSE" and if I omit it I get the full list of available fields. Did that exactly to show that there were no obvious equivalents.
As for Nick's answer: Yes, I realized that I could emulate the old result in this specific case by selecting some of the fields. My issue is more, for example, on how can I be sure that the old CLOSE will always match the BID for currencies? Is there some resource/docs that I can use for dealing with this issue of equivalence between old and new apis, for currencies and for other assets?
Regards
0 -
Hi @valstar
In this case I would advise looking into the Data Item Browser to find the field you're after:
Trying it myself, I got:df= ld.get_history(
universe=["CAD="],
fields=["TR.AMERICACLOSEBIDPRICE", "TR.ASIACLOSEBIDPRICE", "TR.EUROPECLOSEBIDPRICE"],
start='2025-03-18',
end='2025-03-24',
interval='daily')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 中文论坛