Can I download historical stock price data using the API for a list of CUSIPs (6-digit)?

Best Answer
-
hi @sanhitha.jugulum thanks for your question - if you have cusip codes its a 2 step operation involving firstly our get_symbology API call which can convert between different symbology types (CUSIP to RIC in this case) and once we have our RICS we can get our monthly closing price data. Please see the code sample below:
df1 = ek.get_symbology(['594918104','88160R101'],from_symbol_type ='CUSIP',to_symbol_type='RIC')
df2 = ek.get_timeseries(df1.RIC.to_list(), fields='CLOSE',
start_date='2010-03-01',end_date='2020-04-26',interval='monthly')
df2I hope this can help you.
0
Answers
-
Thanks, Jason! That is definitely helpful! But there is a slight glitch. I have 6-digit CUSIPs (issuer CUSIPs). Will the API take that as a valid argument?
0 -
I suggest that you convert the CUSIP to RIC code first.
If they are valid identifier, you can use it with get_timeseries()
Here, I am demonstrating that the CUSIP and RIC can be converted:
Once you have the RIC, you can get the historical price.
For more information on historical price, you can use help(ek.get_timeseries) in your Python code.
Or you can visit https://docs-developers.refinitiv.com/1595318014557/14684/book/en/eikon/index.html#get_timeseries
0 -
Hi @sanhitha.jugulum - sadly the symbology API works only with specific instruments (full CUSIP 9-digit codes) rather than CUSIP issuer codes (issuers might have a number of instruments). How big is your list - if its not too big you could just try copy pasting the 6 digit CUSIPS into eikon search bar which it seems to resolve correctly.
One other approach would be to use our excellent new CODEBOOK app (type CODEBOOK into Eikon search bar) which provides you access to our new RDP libraries which provides a new search API service. I have tried that and it does work programatically.
There is a full sample in the examples/02-Refinitiv Data Platform Library/1.5.0 - Function - Search.ipynb . So in there you can just replace the IBM RIC with your six digit CUSIP and it will return the following. So the top code is the most relevant I believe. So if you wrapped you list of six digit CUSIPs in a for-loop you will easily be able to achieve resolution.
0
Categories
- All Categories
- 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
- 613 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
- 629 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
- 86 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛