Check the Setup
- Python 3.10 or newer
- An internet connection
- The requests Python package
Official daily U.S. Treasury par yield curve rates in XML for building dated fixed-income context and comparing interest-rate terms.
Report a ProblemFrom Source to Product Signal
Treasury publishes daily par yield curves through a dated XML feed. Start with the current month and the 10-year tenor, retaining the observation date. A par yield is not a real-time trade quote or an option's realized return.
Install the packages, then run the notebook cell.
python -m pip install requests
from datetime import date
import xml.etree.ElementTree as ET
import requests
month = date.today().strftime("%Y%m")
response = requests.get(
"https://home.treasury.gov/resource-center/data-chart-center/interest-rates/pages/xml",
params={
"data": "daily_treasury_yield_curve",
"field_tdr_date_value_month": month,
},
timeout=30,
)
response.raise_for_status()
root = ET.fromstring(response.content)
for entry in list(root)[-5:]:
fields = {node.tag.rsplit("}", 1)[-1]: node.text for node in entry.iter()}
print(fields.get("NEW_DATE", "")[:10], fields.get("BC_10YEAR"))Test a Useful Signal
Test whether a short yield-curve series supports a fixed-income context panel.
U.S. Department of the Treasury is a government source. Last verified 2026-09-28. Temporal coverage: daily par yield curve rates from 1990 to present.