Get the Current Account Balance for a variety of countries over time from the Global Macro Database (GMDB). The Current Account Balance is the sum of the balance of trade (exports minus imports of goods and services), net factor income (such as interest and dividends) and net transfer payments (such as foreign aid).

The balance is annual and expressed in millions of national currency, with a negative value marking a current account deficit and a positive value a surplus.

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: current account, trade balance, balance of payments.

No programming experience? With the Finance Toolkit MCP server, AI assistants such as Claude and ChatGPT can calculate the Current Account Balance for you. Just ask in plain English.

Calculate the Current Account Balance in Python

The Current Account Balance is available in the Economics module of the open-source Finance Toolkit. Install it with:

pip install financetoolkit -U

Then call get_current_account_balance as shown below.

from financetoolkit import Economics

economics = Economics(start_date='2015-01-01')

economics.get_current_account_balance(countries=['France', 'Germany', 'Italy'])

Which returns:

  France Germany Italy
2015 -7154.56 259781 20674.6
2016 -11784 270199 41956.5
2017 -12535.5 255962 42548.2
2018 -16440.4 267594 44461.4
2019 14520.3 283851 56954.4
2020 -47594.2 222500 62809.1
2021 6947.44 263455 38674.2
2022 -31095.1 164638 -34928.5
2023 -28111.7 257704 -297.92
2024 2650.74 286059 23619.7
2025 -3590.1 285609 31890.9

Parameters

get_current_account_balance accepts the following parameters:

  • countries (list[str] | str | None, optional): A list of countries or a single country to include in the results. Defaults to None.
  • rolling (int, optional): The rolling window size to use for smoothing the data (simple moving average). Defaults to None.
  • trailing (int, optional): The trailing window size to use for summing the data over trailing periods (e.g. a trailing-4-quarter sum). Defaults to None.
  • growth (bool, optional): Whether to return the growth data or the actual data. Defaults to False.
  • lag (int, optional): The number of periods to lag the growth data. Defaults to 1.
  • standardize (bool, optional): Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.
  • rounding (int | None, optional): The number of decimals to round the results to. Defaults to None.

The Economics module page introduces the module, and the sidebar lists all of its functions.

Share