Get the credit-to-GDP gap: how far the ratio of credit to the private non-financial sector to GDP lies above or below its long-term trend, in percentage points of GDP. The trend is a one-sided Hodrick-Prescott filter with a smoothing parameter of 400,000, which only uses the quarters up to each point, so the gap is what was known at the time.

A gap that stays above two percentage points of GDP has preceded most banking crises of the past decades, often by several years, which is why Basel III uses it as the guide for the countercyclical capital buffer: banks hold extra capital when the gap is wide (Drehmann and Tsatsaronis, 2014). A negative gap means credit grew slower than its trend, as it did in most advanced economies after the 2008 crisis.

The credit is all credit to households and non-financial corporations from all lenders, banks and non-banks, at market value, as compiled by the Bank for International Settlements for around 45 economies, quarterly and back to the 1950s for some. No API key is needed.

See definition: https://data.bis.org/topics/CREDIT_GAPS and https://www.bis.org/publ/qtrpdf/r_qt1403g.htm

Also known as: credit gap, Basel gap, credit-to-GDP deviation from trend.

Credit-to-GDP Gap in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_credit_to_gdp_gap as shown below.

from financetoolkit import Economics

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

economics.get_credit_to_gdp_gap(countries=['United States', 'Euro Area', 'China', 'Japan'])

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

What was the credit-to-GDP gap of the United States, the euro area, China and Japan in each quarter of 2025?

Which returns:

  United States Euro Area China Japan
2025Q1 -0.126 -0.1909 -0.0443 0.0461
2025Q2 -0.1236 -0.1894 -0.053 0.0335
2025Q3 -0.12 -0.1873 -0.0639 0.0418
2025Q4 -0.1159 -0.1815 -0.0769 0.0587

Parameters

get_credit_to_gdp_gap accepts the following parameters.

ParameterTypeDescriptionExample
countrieslist[str] | str | NoneThe countries to include in the data. Defaults to None.["United States", "Germany"]
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. 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 data by. 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
Share