Estimating Historical Daily Market Capitalization from Shares and Prices
Summary
The document describes ways to obtain historical equity market capitalization when a user lacks access to a paid data terminal. One approach is to retrieve outstanding-share fundamentals through a data provider’s API, then multiply those shares by historical stock prices. It also points to a charting data source that may provide monthly outstanding-share history or market capitalization directly, accessible in JSON format. A separate answer mentions a source for one company’s historical market cap, while noting that it does not offer broad coverage.
The key limitation is share-count timing: outstanding shares may update only monthly, so multiplying that figure by daily prices creates an estimate rather than a fully daily observed market cap. More frequent accuracy may require reviewing company filings. Access conditions and coverage can vary by provider, and the example is limited to a single security and would need extension for multiple symbols and dates. The document is a practical data-acquisition outline, not an evaluation of source reliability or a trading method.
Key ideas
- Historical market capitalization can be estimated by multiplying share price by shares outstanding.
- Fundamental data APIs may provide historical share counts that can be paired with price histories.
- Some data sources report market capitalization directly, while others provide monthly share counts.
- Monthly updates to outstanding shares can make calculated daily market caps approximate.
- Company filings may be needed when more precise share-count timing is important.
Tags
Full text
# How to get a Daily Market Cap using Python
# How to get a Daily Market Cap using Python
I'm looking for a way of getting free historical daily market caps ? I can get todays Market cap from yahoo but need old market caps also.. thanks for the help.
ps: I don't have Bloomberg and school doesn't provide us with any data provider access.
## Answer by amdopt (score 5)
https://quant.stackexchange.com/a/54048
Tiingo.com has fundamental data available through an API you can access using Python. I'm not sure if you have to pay for it or if it's included with a free account. Either way, the outstanding shares are on the balance sheet within the fundamental data you can get through their REST API.
YCharts has this data on a monthly basis too. See example here. From looking through the page, using Python `requests` you can get the data easily in JSON format and using the `json` package and use it how you like from there.
I just threw this code together as an example. The output is a list in [unix_time, shares_outstanding] format.
```
import requests
import json
response = requests.get('https://ycharts.com/charts/fund_data.json?securities=include%3Atrue%2Cid%3AMSFT%2C%2C&calcs=include%3Atrue%2Cid%3Ashares_outstanding%2C%2C&correlations=&format=real&recessions=false&zoom=5&startDate=&endDate=&chartView=&splitType=single&scaleType=linear¬e=&title=&source=false&units=false"eLegend=true&partner="es=&legendOnChart=true&securitylistSecurityId=&clientGroupLogoUrl=&displayTicker=false&ychartsLogo=&useEstimates=false&maxPoints=880')
json_data = {}
json_data['MSFT'] = json.loads(response.text)
```
You can access the data by doing something like this to get the most recent data:
```
json_data['MSFT']['chart_data'][0][0]['raw_data'][-1]
```
Resulting in: `[1587686400000, 7583.4402]`
After that just grab prices and multiply by shares outstanding and you have market caps. You may have to assume that outstanding shares are only updated once per month unless you want to dig through EDGAR filings.
The above code is only an exmaple of grabbing data for one stock. It would need to be altered a bit to make is usable for a list of stocks or list of dates, etc. To get market cap directly instead of the outstanding shares just replace `shares_outstanding` with `market_cap` in the `requests.get()` call string. The output would be daily market caps in the same [unix, data] format.
## Answer by Hamish Gibson (score 0)
https://quant.stackexchange.com/a/54047
I have found a source for Apple's historical market cap here. Whilst this source doesn't have a hollistic view of all companies listed, I'm sure they're available just by searching and it appears to go quite far back in time too. I hope this helps.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.