data download

hi what would be the code to download.

several symbols/instrument, for daily timer series ratios such as price to book, price to earnings, marketcap, dividend yield, dividend

Best Answer

  • Jirapongse
    Answer ✓

    @ken03

    Thank you for reaching out to us.

    You can specify a list of instruments in the instruments parameter.

    df, err = ek.get_data(
        instruments = ['AAPL.O','IBM.N'],
        fields = [
        'TR.PriceClose.date',
        'TR.BVPSActValue',
        'TR.EPSActValue',
        'TR.PriceToBVPerShare',
        'TR.PriceClose'
        ],
        parameters = {'SDate': '2020-01-01', 'EDate': '2023-01-01'}
        )
    display(df)

Answers

  • Hi @ken03 ,

    Could you please let me know which API are you using for better suggestion? Is it RD Library for Python, Eikon Data API, or others?

    1. df, err = ek.get_data(
    2. instruments = ['AAPL.O'],
    3. fields = [
    4. 'TR.PriceClose.date',
    5. 'TR.BVPSActValue',
    6. 'TR.EPSActValue',
    7. 'TR.PriceToBVPerShare',
    8. 'TR.PriceClose'
    9. ],
    10. parameters = {'SDate': '2020-01-01', 'EDate': '2023-01-01'}
    11. )
    12. display(df)

    i am using this