question

Upvotes
Accepted
1 0 0 0

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!


pythonrdp-api#producthistorical
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.

Hello @novasbe11


Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,


AHS


Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,
AHS

1 Answer

· Write an Answer
Upvote
Accepted
1.3k 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.