Get the Investment for a variety of countries over time from the Global Macro Database (GMDB). Investment is gross capital formation: what businesses, households and the government spend on fixed assets such as machinery, equipment, buildings and dwellings, plus the change in inventories.

The level is annual and expressed in millions of national currency, so levels are not comparable across countries with different currencies, but growth rates are.

Data comes from the Global Macro Database (GMDB), further information about the variable can be found within https://www.globalmacrodata.com/documentation.html

Also known as: total investment, capital formation.

Total Investment in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_investment as shown below.

from financetoolkit import Economics

economics = Economics(start_date='2014-01-01', end_date="2025-12-31")

investment = economics.get_investment()

investment.loc[:, ['United States', 'Portugal', 'China']]

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

How much did the United States, Portugal and China invest each year, in national currency, from 2014 to 2025?

Which returns:

  United States Portugal China
2014 3.68031e+06 26574.5 2.97145e+07
2015 3.91791e+06 28591.6 3.00218e+07
2016 3.92796e+06 29873.8 3.20756e+07
2017 4.14909e+06 34109.1 3.60559e+07
2018 4.45542e+06 37975.2 4.05422e+07
2019 4.66767e+06 40256 4.29201e+07
2020 4.58237e+06 39037.7 4.40568e+07
2021 5.07881e+06 45322.5 5.01014e+07
2022 5.739e+06 52142.2 5.22678e+07
2023 5.99898e+06 55414.9 5.3233e+07
2024 6.30862e+06 58942.6 5.47878e+07
2025 6.56842e+06 64530.2 5.47964e+07

Parameters

get_investment accepts the following parameters.

ParameterTypeDescriptionExample
countrieslist[str] | str | NoneA list of countries or a single country to include in the results. Defaults to None.["United States", "Germany"]
usdboolWhether to return the values in millions of US dollars, converted by the Global Macro Database, instead of millions of national currency, which makes levels comparable across countries. Defaults to False.True
rollingintThe rolling window size to use for smoothing the data (simple moving average). Defaults to None.4
trailingintThe trailing window size to use for summing the data over trailing periods (e.g. a trailing-4-quarter sum). Defaults to None.4
growthboolWhether to return the growth data or the actual data. Defaults to False.True
lagintThe number of periods to lag the growth data. Defaults to 1.4
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
roundingint | NoneThe number of decimals to round the results to. Defaults to None.2
gmdb_forecastsboolWhether to include the years the Global Macro Database projects, from the IMF’s World Economic Outlook, up to five years ahead. Only applies to data from the Global Macro Database. Defaults to False, which ends a series with its last observation.True
Share