Output Gap
Get the Output Gap for a variety of countries over time from the OECD Economic Outlook. The output gap is the difference between actual Gross Domestic Product (GDP) and estimated potential GDP, expressed as a percentage of potential GDP. Potential GDP is the level of output an economy can sustain over the long term without generating excess inflationary or disinflationary pressure, based on the full, non-inflationary use of its productive resources (labour, capital and technology).
A positive output gap indicates the economy is running above its long-run potential (an economic “boom”, typically associated with rising inflationary pressure), while a negative output gap indicates the economy is running below potential (an economic “slack”, typically associated with rising unemployment and disinflationary pressure). The output gap therefore complements indicators such as the Inflation Rate and Unemployment Rate as a measure of where an economy sits within the business cycle.
Formula:
Output Gap = (Actual GDP - Potential GDP) / Potential GDP
This data is only available on a yearly basis, since the OECD Economic Outlook is published as a set of annual projections and estimates.
Changed in v2.2.0: the result is now a decimal fraction (-0.0422) rather than the percentage of potential GDP the OECD publishes (-4.2231), matching every other rate and ratio in this class. Multiply by 100 to recover the published figure. Note that a small gap loses resolution at the default rounding of 4 decimals – pass a larger rounding when the sub-basis-point detail matters.
See definition: https://www.oecd.org/en/data/indicators/output-gaps.html
Also known as: business cycle gap, GDP gap.
No programming experience? With the Finance Toolkit MCP server, AI assistants such as Claude and ChatGPT can calculate the Output Gap for you. Just ask in plain English.
Calculate the Output Gap in Python
The Output Gap is available in the Economics module of the open-source Finance Toolkit. Install it with:
pip install financetoolkit -U
Then call get_output_gap as shown below.
from financetoolkit import Economics
economics = Economics(start_date='2018-01-01', end_date='2022-01-01')
economics.get_output_gap(countries=['United States', 'Germany', 'Japan'])
Which returns:
| United States | Germany | Japan | |
|---|---|---|---|
| 2018 | 0.0002 | 0.019 | 0.0194 |
| 2019 | 0.0015 | 0.0201 | 0.0072 |
| 2020 | -0.0422 | -0.0315 | -0.0422 |
| 2021 | -0.0073 | -0.0005 | -0.0137 |
| 2022 | -0.0066 | 0.0108 | -0.0049 |
Parameters
get_output_gap accepts the following parameters:
- countries (list[str] | str | None, optional): The countries to include in the data. 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.
- lag (int, optional): The number of periods to lag the data by.
- 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.
Related Government
The Economics module page introduces the module, and the sidebar lists all of its functions.