Python: Historical marketcap/shares outstanding for specific dates and stocks using RDP API.

Hi,

I need to retrieve market cap at specific points in time. The code below works, but only for the current value:

rdp.get_data(

universe=[ "AAPL.O"],

fields=['TR.TtlCmnSharesOut'])

Any chance to pull the historical values. Btw. Mac OSX user, so cannot make use of eikon API.

Thanks in advance!


Best Answer

  • pf
    pf
    Answer ✓

    Hi @novasbe11 ,

    You can specify a range of dates to retrieve historical data.

    Following example will retrieve Dec 2023 daily field values :

    rdp.get_data(
    universe=[ "AAPL.O"
    fields=['TR.TtlCmnSharesOut'],
    parameters={"SDate": "2023-12-01", "EDate": "2023-12-31", "Frq": "D", "CH": "Fd"})

    If you're using RDP lib, note that you should migrate to RD which is the supported release library (RDP is a beta version no more updated).


Answers

  • To retrieve historical market cap and shares outstanding data for specific dates and stocks using the RDP API in Python, you'll need to adjust your code to include a historical date range.

    fnaf