Get the Imports for a variety of countries over time from the Global Macro Database (GMDB). Imports are the total amount of goods and services produced in other countries that are bought by a country.

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: imports, trade imports.

Imports in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_imports as shown below.

from financetoolkit import Economics

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

economics.get_imports(countries=['United States', 'Canada', 'Mexico'])

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

How much did the United States, Canada and Mexico import each year, in national currency, from 2010 to 2025?

Which returns:

  United States Canada Mexico
2010 2.38956e+06 517153 4.22154e+06
2011 2.69548e+06 564513 4.8355e+06
2012 2.76932e+06 589137 5.41225e+06
2013 2.76638e+06 606801 5.41757e+06
2014 2.88744e+06 651176 5.92175e+06
2015 2.79494e+06 683019 6.96894e+06
2016 2.73883e+06 685868 8.05624e+06
2017 2.93159e+06 720254 8.88029e+06
2018 3.13117e+06 766265 9.93588e+06
2019 3.11668e+06 782419 9.78484e+06
2020 2.78239e+06 703532 9.07008e+06
2021 3.41793e+06 787922 1.13375e+07
2022 3.97432e+06 951814 1.35378e+07
2023 3.85986e+06 985422 1.19891e+07
2024 4.11383e+06 1.01502e+06 1.27547e+07
2025 4.24615e+06 1.04369e+06 1.41931e+07

Parameters

get_imports 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