Calculates the market capitalization to Gross Domestic Product (GDP) ratio of the tickers as one basket: their total market cap divided by a country’s nominal GDP in US dollars.

This is the Buffett indicator, which Warren Buffett called “probably the best single measure of where valuations stand at any given moment” (Fortune, 2001): the value of a country’s whole stock market against the annual output of its economy. Its classic form divides the total US market (the Wilshire 5000) by US GDP, which is why the United States is the default country. A basket of tickers is a part of a market, so its ratio is the market value of that basket as a share of an economy’s annual output, for example the largest technology companies against the GDP of China. Market cap is a stock (a value at a moment) and GDP a flow (the output of a year), so the ratio compares a value with a year of income rather than two values.

The formula is as follows:

\[\text{Market Cap to GDP} = \text{Basket Market Capitalization} / \text{Nominal GDP} (\text{last complete year})\]

The basket market cap is the sum of the market caps of the tickers, as get_market_cap returns it for a basket Toolkit (the traded close times the weighted average diluted shares), so the tickers must be listed in US dollars. The GDP is the nominal GDP in current US dollars of the Global Macro Database. GDP is annual and comes without publication dates, so each date (or period) is divided by the GDP of the calendar year before the year it falls in, the last complete year: the close of 9 November 2026 by the GDP of 2025, the 2025 value by the GDP of 2024. The first estimate of a year is published in the first months of the next year, so in those months the ratio uses a GDP that was about to be published.

Also known as: Buffett indicator, market cap to GDP, stock market capitalization to GDP, basket market cap to GDP.

Market Cap to GDP in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_market_cap_to_gdp as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["NVDA", "MSFT", "GOOGL", "AMZN", "META", "AVGO", "TSM"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2025-01-01",
    end_date="2026-11-06",
)

toolkit.ratios.get_market_cap_to_gdp(country="China", show_daily=True).tail()

Or, after setting up the Finance Toolkit MCP, ask:

How large was the combined market value of Nvidia, Microsoft, Alphabet, Amazon, Meta, Broadcom and TSMC relative to China's GDP on the last five trading days up to 6 November 2026?

Which returns:

Date China
2026-11-02 1.0252
2026-11-03 1.0458
2026-11-04 1.0621
2026-11-05 1.0009
2026-11-06 1.0132

Parameters

get_market_cap_to_gdp accepts the following parameters.

ParameterTypeDescriptionExample
countrystrThe country whose GDP the basket is divided by, as named in toolkit.economics.get_gross_domestic_product. Defaults to “United States”."US"
show_dailyboolWhether to show daily values: the close of each trading day against the shares of the latest period that has ended and the GDP of the last complete year. Defaults to False.True
dilutedboolWhether to use diluted shares in the calculation. Defaults to True.False
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise).2
growthboolWhether to calculate the growth of the ratios. Defaults to False.True
lagint | list[int]The lag to use for the growth calculation. Defaults to 1.4
compoundboolWhether 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
standardizeboolWhether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.True
show_columnsstr | list[str] | NoneThe columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column.None, which keeps every column
Share