Market Capitalization
Calculates the market capitalization of the company.
Market capitalization, often referred to as “market cap,” is the total value of a company’s outstanding shares of stock in the stock market. It is calculated by multiplying the share price at the end of each period by the weighted average (diluted) number of shares outstanding in that period. The share price is the close as traded, adjusted for splits but not for dividends, as are the prices of every price-based ratio (P/E, P/B, the enterprise value multiples and the dividend, earnings and free cash flow yields).
The formula is as follows:
\[\text{Market Capitalization} = \text{Share Price} \cdot \text{Weighted Average} (\text{Diluted}) \text{Shares}\]Market cap is a point-in-time value, so the price is the close on the last trading day of each calendar period (or of each day with show_daily) and never an average. The periods follow the calendar, so for a company whose fiscal year ends in, for example, September, the price of the year is the December close while the shares come from the fiscal year. With show_daily, each day uses the shares of the latest period that has ended.
Also known as: market capitalization.
Market Capitalization in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_market_cap as shown below.
from financetoolkit import Toolkit
toolkit = Toolkit(
["NVDA", "AAPL", "MSFT"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2021-01-01",
end_date="2025-12-31",
)
toolkit.ratios.get_market_cap()
Or, after setting up the Finance Toolkit MCP, ask:
How did the market capitalization of Nvidia, Apple and Microsoft develop from 2021 to 2025?
Which returns:
| 2021 | 2022 | 2023 | 2024 | 2025 | |
|---|---|---|---|---|---|
| AAPL | 2.9947e+12 | 2.12121e+12 | 3.04439e+12 | 3.8585e+12 | 4.07918e+12 |
| MSFT | 2.55872e+12 | 1.80824e+12 | 2.80977e+12 | 3.14818e+12 | 3.61022e+12 |
| NVDA | 7.45569e+11 | 3.66373e+11 | 1.23508e+12 | 3.33093e+12 | 4.57186e+12 |
Parameters
get_market_cap accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
show_daily | bool | Whether to show daily values: the close of each trading day against the statement figures of the latest period that has ended on or before that day (also when it ended before the start date), so no figures are used before their period closes. Defaults to False. | True |
diluted | bool | Whether to use diluted shares in the calculation. Defaults to True. | False |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise). | 2 |
growth | bool | Whether to calculate the growth of the ratios. Defaults to False. | True |
lag | int | list[int] | The lag to use for the growth calculation. Defaults to 1. | 4 |
compound | bool | Whether the growth is the compound annual growth rate over the lag (e.g. lag=5 for the five-year CAGR) instead of the total change. Defaults to False. | False |
standardize | bool | Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False. | True |