Government Bond Yield Curve
Retrieves the government bond yield curve of a variety of countries, every maturity a country’s government borrows at, from treasury bills to bonds of 30 years and more. The yield curve is the basis for discounting cash flows and pricing bonds, and its shape is one of the most watched signals in markets: an inverted curve, with short rates above long rates, has preceded most recessions.
Every curve comes from the official source without an API key:
- United States: the U.S. Department of the Treasury’s par yield curve, 1 month to 30 years, from 1990.
- Euro Area: the yield curve the European Central Bank estimates from the bonds of all euro area central governments, 3 months to 30 years, from 2004.
- Germany: the term structure the Deutsche Bundesbank estimates from listed federal securities, 1 to 30 years.
- United Kingdom: the Bank of England’s nominal par yields of gilts, 5, 10 and 20 years.
- Japan: the Ministry of Finance’s Japanese government bond yields, 1 to 40 years, from 1974.
- Canada: the Bank of Canada’s treasury bill yields (1 month to 1 year, weekly) and benchmark bond yields (2 to 30 years).
- Sweden: the Riksbank’s treasury bill and government bond yields, 1 month to 10 years.
- Norway: Norges Bank’s generic government bond yields, 3 to 10 years.
- Australia: the Reserve Bank of Australia’s government bond yields interpolated to 2, 3, 5 and 10 years, from 2013.
With period=”monthly”, every other European Union member, such as France, Italy, Spain, the Netherlands and Poland, is included with its 10-year yield, the long-term interest rate for convergence purposes the ECB publishes monthly. For other countries no official source publishes a curve without a key; see get_government_bond_yield for the monthly 3-month and 10-year rates of around forty countries from the OECD. Only the requested countries are retrieved, and only the days that are not cached yet.
The yields are returned as decimal fractions per annum (0.0419 for 4.19%), with one column per country and maturity, sorted from the shortest to the longest maturity. Weekly and monthly periods take the yields on the last trading day of each period (weeks end on Friday).
Also known as: yield curve, term structure of interest rates, sovereign curve, treasury curve, bund curve, gilt curve, JGB curve.
Government Bond Yield Curve in Python
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_government_bond_yield_curve as shown below.
from financetoolkit import FixedIncome
fixedincome = FixedIncome(start_date='2026-09-28', end_date='2026-10-01')
yield_curve = fixedincome.get_government_bond_yield_curve(
countries=['United States', 'Germany']
)
yield_curve['Germany'][['1Y', '2Y', '5Y', '10Y', '20Y', '30Y']]
Which returns:
| 1Y | 2Y | 5Y | 10Y | 20Y | 30Y | |
|---|---|---|---|---|---|---|
| 2026-09-28 | 0.031 | 0.0332 | 0.0344 | 0.0369 | 0.0393 | 0.0401 |
| 2026-09-29 | 0.0307 | 0.0329 | 0.0341 | 0.0368 | 0.0394 | 0.0403 |
| 2026-09-30 | 0.0304 | 0.0324 | 0.0336 | 0.0364 | 0.039 | 0.0399 |
| 2026-10-01 | 0.0302 | 0.0321 | 0.0335 | 0.0366 | 0.0394 | 0.0403 |
Parameters
The function accepts the following parameters:
- countries (list[str] | str | None, optional): The countries to retrieve, from “United States”, “Euro Area”, “Germany”, “United Kingdom”, “Japan”, “Canada”, “Sweden”, “Norway” and “Australia”, and with period=”monthly” any European Union member. Defaults to None, which retrieves every country.
- period (str, optional): Whether to return the daily, weekly or monthly data. Defaults to “daily”.
- rounding (int | None, optional): The number of decimals to round the results to. 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.