Get the Government Revenue to GDP Ratio for a variety of countries over time from the Global Macro Database (GMDB). The Government Revenue to GDP Ratio is the ratio of the total amount of money that a government collects from taxes and other sources to the Gross Domestic Product (GDP).

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

The ratio is expressed as a decimal fraction (0.3104 for 31.04% of GDP).

The ratio is the Global Macro Database’s own figure, published in percent and divided by 100 here.

The formula is as follows:

\[\text{Government Revenue to GDP Ratio} = \text{Government Revenue} / \text{Nominal GDP},\;\; \text{using the level of government selected with level ("consolidated" by default)}\]

Also known as: revenue to GDP ratio.

Revenue to GDP in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_government_revenue_to_gdp_ratio as shown below.

from financetoolkit import Economics

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

economics.get_government_revenue_to_gdp_ratio(countries=['United States', 'Canada', 'Russian Federation'])

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

How did government revenue as a share of GDP compare in the United States, Canada and Russia from 2015 to 2025?

Which returns:

  United States Canada Russian Federation
2015 0.3324 0.3996 0.3189
2016 0.3275 0.403 0.3292
2017 0.3343 0.4034 0.3336
2018 0.3169 0.4102 0.3554
2019 0.3167 0.4057 0.3568
2020 0.3239 0.4141 0.3516
2021 0.3351 0.4241 0.3572
2022 0.348 0.4103 0.338
2023 0.3146 0.4165 0.339
2024 0.3174 0.4222 0.3506
2025 0.3253 0.4219 0.3523

Parameters

get_government_revenue_to_gdp_ratio 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"]
levelstrThe government the figures cover: “consolidated” (the Global Macro Database’s combination of general and central government figures, with the longest history), “general” (general government: central, state and local government and social security) or “central” (central government only). Defaults to “consolidated”."general"
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