Get the government bond yield for a variety of countries over time from the OECD. By default this is the long-term (10-year) government bond yield; set short_term=True to get the short-term (3-month) rate instead. The two maturities are described below.

Long-term (short_term=False): long-term interest rates refer to government bonds maturing in ten years. Rates are mainly determined by the price charged by the lender, the risk from the borrower and the fall in the capital value. Long-term interest rates are generally averages of daily rates, measured as a percentage. These interest rates are implied by the prices at which the government bonds are traded on financial markets, not the interest rates at which the loans were issued.

In all cases, they refer to bonds whose capital repayment is guaranteed by governments. Long-term interest rates are one of the determinants of business investment. Low long term interest rates encourage investment in new equipment and high interest rates discourage it. Investment is, in turn, a major source of economic growth.

See definition: https://data.oecd.org/interest/long-term-interest-rates.htm

Short-term (short_term=True): short-term interest rates are the rates at which short-term borrowings are effected between financial institutions or the rate at which short-term government paper is issued or traded in the market. Short-term interest rates are generally averages of daily rates, measured as a percentage. They are based on three-month money market rates where available; the OECD source specifically returns the 3-month interbank offered rate rather than a government bill yield, so for most countries it tracks the central bank’s policy rate closely.

See definition: https://data.oecd.org/interest/short-term-interest-rates.htm

Also known as: treasury yield, bond yield by maturity.

3-Month Government Bond Yield in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_government_bond_yield as shown below.

from financetoolkit import FixedIncome

fixedincome = FixedIncome(start_date='2023-05-01', end_date='2023-12-31')

long_term_interest_rate = fixedincome.get_government_bond_yield(short_term=False, period='monthly')

long_term_interest_rate.loc[:, ['Japan', 'United States', 'Germany']]

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

How did long-term government bond yields in Japan, the United States and Germany move in each month from May to December 2023?

Which returns:

  Japan United States Germany
2023-05 0.0043 0.0357 0.0234
2023-06 0.004 0.0375 0.0238
2023-07 0.0059 0.039 0.0246
2023-08 0.0064 0.0417 0.0255
2023-09 0.0076 0.0438 0.0266
2023-10 0.0095 0.048 0.0282
2023-11 0.0066 0.045 0.026
2023-12 0.0062 0.0402 0.021

Parameters

get_government_bond_yield accepts the following parameters.

ParameterTypeDescriptionExample
short_termboolWhether to return the short-term interest rate. Defaults to False. This means that the long-term interest rate will be returned.True
periodstr | NoneWhether to return the monthly, quarterly or the annual data. Defaults to None, which returns the monthly data (quarterly when the class was created with quarterly=True)."quarterly"
growthboolWhether to return the growth data or the actual data. Defaults to False.True
lagintThe number of periods to lag the growth data by. Defaults to 1.4
roundingint | NoneThe number of decimals to round the results to. Defaults to None.2
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
Share