U.S. Treasury API: Get Treasury yields
Gets official daily Treasury par yield curve rates for a date, or the latest published date on or before it.
Unofficial. Not affiliated with or endorsed by U.S. Treasury.
Inputs
Values from the run on Oct 23, 2026, shown under Output.
- Date optional
date Requested calendar date (YYYY-MM-DD), such as 2024-01-01. Defaults to today and returns the latest published date on or before it.
Not set
Date.
Input as JSON
{}Output
{ "date": "2026-10-22", "page_url": "https://home.treasury.gov/resource-center/data-chart-center/interest-rates/daily-treasury-rates.csv/2026/all?type=daily_treasury_yield_curve&page&_format=csv" , "yield_1_year": 4.41, "yield_2_year": 4.65, "yield_3_year": 4.72, "yield_5_year": 4.78, "yield_7_year": 4.86, "yield_10_year": 4.96, "yield_1_month": 4.11, "yield_20_year": 5.32, "yield_2_month": 4.16, "yield_30_year": 5.29, "yield_3_month": 4.22, "yield_4_month": 4.29, "yield_6_month": 4.29, "yield_1_5_month": 4.1}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"home.treasury.gov/get_treasury_yields","input":{}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "home.treasury.gov/get_treasury_yields" , "input": {}})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "home.treasury.gov/get_treasury_yields" , "input": {} }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run home.treasury.gov/get_treasury_yields# with {}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "properties": { "date": { "type": "string", "format": "date", "description": "Requested calendar date (YYYY-MM-DD), such as 2024-01-01. Defaults to today and returns the latest published date on or before it." } }, "additionalProperties": false}Output schema
{ "type": "object", "required": [ "date", "yield_1_month", "yield_1_5_month", "yield_2_month", "yield_3_month", "yield_4_month", "yield_6_month", "yield_1_year", "yield_2_year", "yield_3_year", "yield_5_year", "yield_7_year", "yield_10_year", "yield_20_year", "yield_30_year", "page_url" ], "properties": { "date": { "type": "string", "format": "date", "description": "Publication date for these rates." }, "page_url": { "type": "string", "description": "Official Treasury link to this year’s published rates." }, "yield_1_year": { "type": [ "number", "null" ], "description": "Treasury yield in percent, or null when not published." }, "yield_2_year": { "type": [ "number", "null" ], "description": "Treasury yield in percent, or null when not published." }, "yield_3_year": { "type": [ "number", "null" ], "description": "Treasury yield in percent, or null when not published." }, "yield_5_year": { "type": [ "number", "null" ], "description": "Treasury yield in percent, or null when not published." }, "yield_7_year": { "type": [ "number", "null" ], "description": "Treasury yield in percent, or null when not published." }, "yield_10_year": { "type": [ "number", "null" ], "description": "Treasury yield in percent, or null when not published." }, "yield_1_month": { "type": [ "number", "null" ], "description": "Treasury yield in percent, or null when not published." }, "yield_20_year": { "type": [ "number", "null" ], "description": "Treasury yield in percent, or null when not published." }, "yield_2_month": { "type": [ "number", "null" ], "description": "Treasury yield in percent, or null when not published." }, "yield_30_year": { "type": [ "number", "null" ], "description": "Treasury yield in percent, or null when not published." }, "yield_3_month": { "type": [ "number", "null" ], "description": "Treasury yield in percent, or null when not published." }, "yield_4_month": { "type": [ "number", "null" ], "description": "Treasury yield in percent, or null when not published." }, "yield_6_month": { "type": [ "number", "null" ], "description": "Treasury yield in percent, or null when not published." }, "yield_1_5_month": { "type": [ "number", "null" ], "description": "Treasury yield in percent, or null when not published." } }, "additionalProperties": false}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
home.treasury.gov/get_treasury_yields- Returns
- date, 14 maturity yields in percent, page_url
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method home.treasury.gov/get_treasury_yields with the inputs above.
Ask your agent
- What were the official Treasury par yield curve rates on 2024-03-15?
- Give me the daily Treasury yields for the 10-year and 2-year maturities as of 2023-11-30.
- I need the latest published Treasury par yield curve for today's date, with all 14 maturities.
- Look up the treasury.gov yield curve rates for 2022-06-10 and include the page link.
- Pull the 14-maturity Treasury yield curve from the last business day before 2025-01-01.
See more
All U.S. Treasury methodsGets the U.S. Treasury quarterly reporting exchange rate for a country or currency on a given date. If that quarter has no published record, it uses the latest preceding quarter.
treasury.gov/get_reporting_exchange_ratesReturns US national debt (Debt to the Penny) for a given date, or the latest published day. Dates without a record use the previous published day.
home.treasury.gov/get_national_debtGets current government bond yields from Investing.com's world government bonds table, optionally filtered by country and maturity term.
investing.com/get_bond_yieldsGets the official ECB euro reference exchange rates for a day, or the latest published day. Weekends, holidays and dates before publication return the previous published day.
ecb.europa.eu/get_euro_exchange_ratesReturns Freddie Mac's U.S. 30-year and 15-year fixed mortgage rates for the latest survey or a chosen date, with weekly and year-ago changes, and optionally a weekly history for a date range.
freddiemac.com/get_mortgage_ratesGets decades of yearly commodity or stock-index price history from Macrotrends: yearly average, open, high, low, close, annual change and inflation-adjusted value for gold, silver, crude oil, natural gas, copper, Dow Jones, S&P 500 and Nasdaq. The current year may be incomplete.
macrotrends.net/get_long_term_price_historyGets XE's daily mid-market exchange rate for a past UTC date and converts an amount with it.
xe.com/get_historical_rateReturns Yahoo Finance daily, weekly or monthly price history and total adjusted-close return for a stock, fund, index or cryptocurrency.
finance.yahoo.com/get_price_history