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

I have a list of 6-digit CUSIPs from SDC Mergers and Acquisitions database. I need the historical monthly stock price data for these companies. Is there a way I can use the API to do so?

Best Answer

  • jason.ramchandani01
    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')
    df2

    I hope this can help you.

Answers