Get stock list into readable format for API price download

Hi, got a list of 250 stocks - trying to call the API using the formula:

get_pricing = ek.get_timeseries(RIC_IDS, fields='CLOSE',start_date='2023-09-28',end_date='2023-09-28')


How do I get RIC_IDS into a readable list? Is it the wrong formula? API keeps delivering error message

Best Answer

  • Hi @c.dass


    Please try this,

    RIC_IDS = ['AAPL.O', 'MSFT.O'] # add the 250 instrments into this array
    get_pricing = ek.get_timeseries(RIC_IDS, fields='CLOSE',start_date='2023-09-28',end_date='2023-09-28')
    get_pricing


    screenshot-2023-11-03-at-165526.png

    Hope this helps, if not please share the error so we investigate further.


    Best regards,

    Haykaz

Answers

  • ok thanks - yes got it to work, thanks. Is there a timeout on the API? So if you're trying 1000 stocks you will probably just timeout

  • Hi @c.dass ,


    Yes there is a timeout, but with 1000 I believe it will work. If not you can chunk it into smaller number of RICs (e.g 200) wrap into try except statement and run it.


    Best regards,

    Haykaz

  • great, thanks