question

Upvotes
Accepted
1 0 0 1

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!


python#productrdp-apihistorical
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvote
Accepted
1.4k 3 2 4

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).


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.