You need the US 6‑month Treasury yield in your software, delivered as clean JSON with clear effective dates you can trust. By the end of this guide you will call the Interest Rates API for US_TREASURY_6M, retrieve latest and historical values, compute spreads, summarize fluctuations, build OHLC aggregates, and even estimate simple loan costs off the returned rate—all with GET requests authenticated via an api_key query parameter.
What the US_TREASURY_6M benchmark is and how to read it
US_TREASURY_6M represents the US Treasury yield at the 6‑month maturity. It is categorized as a treasury benchmark, denominated in USD, and delivered with a daily frequency. In API responses, the value is expressed as a percentage per annum (for example, 5.33 means 5.33% annualized). When you plot or compute with it, treat the number as a percentage (not a decimal fraction).
Effective dates in responses tell you which business date each observation corresponds to. For daily series like US_TREASURY_6M, there is no data for weekends or US federal holidays—so date keys in time series are typically business days. The latest endpoint also provides a dates map when multiple symbols are requested, which helps align values by their effective dates.
All code and examples below use the Interest Rates API at interestratesapi.com, authenticated with the api_key query parameter. All requests are GET—no POST methods are used. To start building, Register for an API key and keep it on the query string as shown.
Quick start: authentication and reading JSON fields
The API uses a base URL of https://interestratesapi.com/api/v1/ and requires api_key on the query string. Responses return:
- success: boolean indicating request outcome
- date or start_date/end_date: effective date(s) for the data payload
- rates: a map from symbol to value(s)
- dates: a map from symbol to effective date (latest only, when multiple symbols)
- currencies: a map from symbol to its currency (e.g., USD)
- frequencies: a map from symbol to frequency (e.g., daily) on time series
Below is an official example of the latest endpoint for SOFR that demonstrates authentication and response structure. Copy it to verify connectivity and the response shape. Then replace the symbol with US_TREASURY_6M for your 6‑month Treasury workflow.
curl -s "https://interestratesapi.com/api/v1/latest?api_key=YOUR_API_KEY&symbols=SOFR"
{
"success": true,
"date": "2026-10-01",
"base": "USD",
"rates": {
"SOFR": 3.87
},
"dates": {
"SOFR": "2026-10-01"
},
"currencies": {
"SOFR": "USD"
},
"base_filter_note": null
}
For US_TREASURY_6M, treat the returned value as a percent per annum. Use the date or dates map to anchor business logic such as reporting and accrual boundaries.
Explore the broader MCP documentation here: MCP. For more product info: Interest Rates API MCP. Ready to build? Get started with Interest Rates API and Register for Interest Rates API.
Endpoint 1: Discover symbols (GET /api/v1/symbols)
Use the symbols catalogue to programmatically confirm that US_TREASURY_6M is available and to inspect categories, currencies, and frequencies. Filtering by category and currency reduces payload size.
cURL
Python (requests)
import requests
resp = requests.get(
"https://interestratesapi.com/api/v1/symbols",
params=dict(category="treasury", base="USD", api_key="YOUR_API_KEY")
)
symbols = resp.json()
# Filter for US_TREASURY_6M locally if needed
treasury_6m = [s for s in symbols.get("symbols", []) if s.get("symbol") == "US_TREASURY_6M"]
JavaScript (fetch)
const res = await fetch(
"https://interestratesapi.com/api/v1/symbols?category=treasury&base=USD&api_key=YOUR_API_KEY"
);
const json = await res.json();
const sixMonth = (json.symbols || []).find(s => s.symbol === "US_TREASURY_6M");
PHP
<?php
$url = "https://interestratesapi.com/api/v1/symbols?category=treasury&base=USD&api_key=YOUR_API_KEY";
$json = file_get_contents($url);
$data = json_decode($json, true);
$sixMonth = null;
if (isset($data["symbols"])) {
foreach ($data["symbols"] as $s) {
if ($s["symbol"] === "US_TREASURY_6M") { $sixMonth = $s; break; }
}
}
?>
Sample JSON
This example shows the documented fields for catalogue entries (example includes a central bank rate to illustrate the shape):
Fields to note: symbol, category, currency_code and frequency identify how to query and interpret values. For US_TREASURY_6M, the category will be treasury and currency_code will be USD.
Endpoint 2: Latest value (GET /api/v1/latest)
Get the most recent US_TREASURY_6M value. The rate is a percent per annum. The dates map returns per‑symbol effective dates when you request multiple symbols at once.
cURL
Python (requests)
import requests
r = requests.get(
"https://interestratesapi.com/api/v1/latest",
params=dict(symbols="US_TREASURY_6M", api_key="YOUR_API_KEY")
)
data = r.json()
sixm = data["rates"]["US_TREASURY_6M"]
as_of = data.get("dates", {}).get("US_TREASURY_6M", data.get("date"))
currency = data.get("currencies", {}).get("US_TREASURY_6M", "USD")
JavaScript (fetch)
const res = await fetch(
"https://interestratesapi.com/api/v1/latest?symbols=US_TREASURY_6M&api_key=YOUR_API_KEY"
);
const data = await res.json();
const rate = data.rates["US_TREASURY_6M"];
const asOf = (data.dates && data.dates["US_TREASURY_6M"]) || data.date;
const ccy = (data.currencies && data.currencies["US_TREASURY_6M"]) || "USD";
PHP
<?php
$url = "https://interestratesapi.com/api/v1/latest?symbols=US_TREASURY_6M&api_key=YOUR_API_KEY";
$data = json_decode(file_get_contents($url), true);
$rate = $data["rates"]["US_TREASURY_6M"];
$asOf = isset($data["dates"]["US_TREASURY_6M"]) ? $data["dates"]["US_TREASURY_6M"] : $data["date"];
$currency = isset($data["currencies"]["US_TREASURY_6M"]) ? $data["currencies"]["US_TREASURY_6M"] : "USD";
?>
Sample JSON
Example with two symbols to illustrate the fields. Use the same structure when requesting only US_TREASURY_6M:
Rates are percentages. Use the dates map to label your chart or to gate cache invalidation when the date changes.
Endpoint 3: Historical value on a specific date (GET /api/v1/historical)
Request a snapshot for a given date. If a series is monthly, the API uses the last day with data in that month, but US_TREASURY_6M is daily.
cURL
Python (requests)
import requests
params = {"date": "2025-06-15", "symbols": "US_TREASURY_6M", "api_key": "YOUR_API_KEY"}
resp = requests.get("https://interestratesapi.com/api/v1/historical", params=params)
hist = resp.json()
value = hist["rates"]["US_TREASURY_6M"]
as_of = hist["date"]
ccy = hist["base"]
JavaScript (fetch)
const url = "https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=US_TREASURY_6M&api_key=YOUR_API_KEY";
const resp = await fetch(url);
const hist = await resp.json();
const value = hist.rates["US_TREASURY_6M"];
const asOf = hist.date;
PHP
<?php
$url = "https://interestratesapi.com/api/v1/historical?date=2025-06-15&symbols=US_TREASURY_6M&api_key=YOUR_API_KEY";
$hist = json_decode(file_get_contents($url), true);
$value = $hist["rates"]["US_TREASURY_6M"];
$asOf = $hist["date"];
?>
Sample JSON
Use this endpoint to fill missing points, align rates to trade dates, or run backtests at exact vintage dates.
Endpoint 4: Time series (GET /api/v1/timeseries)
Pull daily series between start and end. The response nests date-to-value maps under the symbol key and includes a frequencies map confirming that US_TREASURY_6M is daily.
cURL
Python (requests)
import requests
params = {
"start": "2025-10-05",
"end": "2026-10-05",
"symbols": "US_TREASURY_6M",
"api_key": "YOUR_API_KEY",
}
r = requests.get("https://interestratesapi.com/api/v1/timeseries", params=params)
ts = r.json()
series = ts["rates"]["US_TREASURY_6M"] # dict of "YYYY-MM-DD" -> value
freq = ts["frequencies"]["US_TREASURY_6M"]
JavaScript (fetch)
const qs = "start=2025-10-05&end=2026-10-05&symbols=US_TREASURY_6M&api_key=YOUR_API_KEY";
const res = await fetch(`https://interestratesapi.com/api/v1/timeseries?${qs}`);
const ts = await res.json();
const points = ts.rates["US_TREASURY_6M"]; // { "2025-01-02": value, ... }
const freq = ts.frequencies["US_TREASURY_6M"];
PHP
<?php
$qs = "start=2025-10-05&end=2026-10-05&symbols=US_TREASURY_6M&api_key=YOUR_API_KEY";
$url = "https://interestratesapi.com/api/v1/timeseries?$qs";
$data = json_decode(file_get_contents($url), true);
$series = $data["rates"]["US_TREASURY_6M"];
$freq = $data["frequencies"]["US_TREASURY_6M"];
?>
Sample JSON
Iterate the date-to-value map to render charts, compute rolling means, or estimate DV01 proxies in risk tools.
Endpoint 5: Fluctuation summary (GET /api/v1/fluctuation)
Obtain start/end values, absolute and percent change, and period high/low. Perfect for monitoring dashboards and alerts.
cURL
Python (requests)
import requests
params = {"start": "2025-10-05", "end": "2026-10-05", "symbols": "US_TREASURY_6M", "api_key": "YOUR_API_KEY"}
res = requests.get("https://interestratesapi.com/api/v1/fluctuation", params=params)
fx = res.json()["rates"]["US_TREASURY_6M"]
start_val, end_val = fx["start_value"], fx["end_value"]
delta, pct = fx["change"], fx["change_pct"]
hi, lo = fx["high"], fx["low"]
JavaScript (fetch)
const url = "https://interestratesapi.com/api/v1/fluctuation?start=2025-10-05&end=2026-10-05&symbols=US_TREASURY_6M&api_key=YOUR_API_KEY";
const res = await fetch(url);
const fx = (await res.json()).rates["US_TREASURY_6M"];
const { start_value, end_value, change, change_pct, high, low } = fx;
PHP
<?php
$url = "https://interestratesapi.com/api/v1/fluctuation?start=2025-10-05&end=2026-10-05&symbols=US_TREASURY_6M&api_key=YOUR_API_KEY";
$data = json_decode(file_get_contents($url), true);
$fx = $data["rates"]["US_TREASURY_6M"];
$start = $fx["start_value"]; $end = $fx["end_value"]; $chg = $fx["change"]; $pct = $fx["change_pct"];
$hi = $fx["high"]; $lo = $fx["low"];
?>
Sample JSON
Fields to note: change is absolute percent points; change_pct is the percentage change relative to start_value (null if start_value is 0). Use high and low for band charts and regulatory reports.
Endpoint 6: OHLC aggregates (GET /api/v1/ohlc)
Build candlesticks from daily data without maintaining your own aggregation job. Choose monthly (default), weekly, or quarterly, and bound with optional start/end.
cURL
Python (requests)
import requests
params = {
"symbols": "US_TREASURY_6M",
"period": "monthly",
"start": "2025-10-05",
"end": "2026-10-05",
"api_key": "YOUR_API_KEY"
}
r = requests.get("https://interestratesapi.com/api/v1/ohlc", params=params)
ohlc = r.json()["rates"]["US_TREASURY_6M"] # array of { period, open, high, low, close, data_points }
JavaScript (fetch)
const qs = "symbols=US_TREASURY_6M&period=monthly&start=2025-10-05&end=2026-10-05&api_key=YOUR_API_KEY";
const res = await fetch(`https://interestratesapi.com/api/v1/ohlc?${qs}`);
const o = await res.json();
const bars = o.rates["US_TREASURY_6M"];
PHP
<?php
$qs = "symbols=US_TREASURY_6M&period=monthly&start=2025-10-05&end=2026-10-05&api_key=YOUR_API_KEY";
$url = "https://interestratesapi.com/api/v1/ohlc?$qs";
$data = json_decode(file_get_contents($url), true);
$bars = $data["rates"]["US_TREASURY_6M"];
?>
Sample JSON
Use data_points to validate completeness for the period. Open/high/low/close are percent per annum within the chosen aggregation bucket.
Endpoint 7: Loan interest cost comparison (GET /api/v1/convert)
This endpoint estimates the total interest cost of a simple loan using the latest rate of each symbol. It also returns a rate_spread and interest_saved when comparing two benchmarks. For US_TREASURY_6M, this is useful to gauge how a Treasury‑based rate compares with another reference for a given horizon.
cURL
Python (requests)
import requests
params = {
"from": "US_TREASURY_6M",
"to": "ECB_MRO",
"amount": 100000,
"term_months": 12,
"api_key": "YOUR_API_KEY"
}
res = requests.get("https://interestratesapi.com/api/v1/convert", params=params)
conv = res.json()
spread = conv["difference"]["rate_spread"]
interest_saved = conv["difference"]["interest_saved"]
JavaScript (fetch)
const url = "https://interestratesapi.com/api/v1/convert?from=US_TREASURY_6M&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_API_KEY";
const out = await (await fetch(url)).json();
const { rate_spread, interest_saved } = out.difference;
PHP
<?php
$url = "https://interestratesapi.com/api/v1/convert?from=US_TREASURY_6M&to=ECB_MRO&amount=100000&term_months=12&api_key=YOUR_API_KEY";
$out = json_decode(file_get_contents($url), true);
$spread = $out["difference"]["rate_spread"];
$saved = $out["difference"]["interest_saved"];
?>
Sample JSON
Use total_interest and total_payment to present side‑by‑side comparisons. rate_spread is the arithmetic difference between the two latest rates in percentage points.
How to compute spreads and payments from US_TREASURY_6M
Spread to another benchmark:
- Request both latest values.
- Compute spread_pp = rate_A - rate_B (percent points). Example: convert returns this as rate_spread.
- For dashboards, include effective dates from the dates map to highlight any staleness differences.
Simple monthly payment (interest‑only) using a returned percent rate r and principal P:
- r_annual_pct = value from rates map (e.g., 5.33)
- r_monthly_decimal = (r_annual_pct / 100) / 12
- interest_only_payment = P * r_monthly_decimal
If you need amortizing payments, apply a standard annuity formula using r_monthly_decimal. Always treat the rate as a percentage when converting to decimal.
Practical implementation details
- Frequency and business days: US_TREASURY_6M is daily. You will not see entries for weekends and typical US market holidays; use the timeseries date keys as the source of truth.
- Units: All rates are percent per annum. Convert to decimal when computing interest amounts.
- Effective dates: For latest with multiple symbols, prefer the dates map; for timeseries, use the date keys. Historical returns a single date field for the requested day.
- Caching: Cache responses keyed by symbol and date. For “latest,” invalidate when the top-level date or the dates map value changes. Consider storing the last seen date to avoid redundant API calls intra‑day.
- Error handling: Check success=false and inspect error. Common statuses include 401 (missing/invalid api_key), 403 (inactive account), 404 (no symbols matched or no data for date/range), 422 (validation), and 429 (quota). On 429, use Retry-After and track X-RateLimit-* headers to pace retries.
- Idempotent GETs: All endpoints are GET. Pass api_key as a query parameter; do not send it as a header.
Helpful links to keep open while building: Interest Rates API and MCP.
Use cases for US_TREASURY_6M in production systems
- Funding dashboards: Display the current 6‑month Treasury alongside short‑term policy benchmarks for treasury desks and CFO portals.
- Risk and valuation: Use the time series to compute sensitivities, stress scenarios, or to calibrate short‑end curve segments.
- Loan and deposit products: Compare a Treasury‑linked internal transfer price to customer‑facing reference rates using the convert endpoint for quick what‑ifs.
- Macro research: Build OHLC views to spot regime shifts and visualize monthly distribution of the 6‑month yield.
- Fintech apps: Integrate daily updates into financial planning or portfolio rebalancing tools that require yield curve context.
End-to-end example with guardrails
Putting it together for US_TREASURY_6M:
- Call /latest for US_TREASURY_6M and read rates["US_TREASURY_6M"] and dates["US_TREASURY_6M"].
- Cache value and as‑of date for display; recheck when your scheduler advances to a new business date.
- For analytics, fetch /timeseries over your backtest window. Validate frequencies["US_TREASURY_6M"] equals "daily".
- Summarize a performance window with /fluctuation to get change and change_pct for headlines.
- Provide monthly aggregates with /ohlc for your chart module; verify data_points to assure completeness.
- If comparing to another benchmark, call /convert to show spread and estimated interest deltas on a simple loan basis.
Troubleshooting and errors you may encounter
- 422 Validation error: Ensure date is Y-m-d, start <= end, and symbols is a comma-separated list of valid identifiers (e.g., US_TREASURY_6M).
- 404 No data for date: For daily series, weekends/holidays return no data on those dates; pick the nearest business date or use timeseries to navigate available keys.
- 429 Request quota exhausted: Respect Retry-After. Track X-RateLimit-Remaining to avoid bursts.
- 401/403 Authentication: Always include api_key on the query string. Do not send it in headers.
FAQ
Q: What timezone applies to the effective dates?
A: Dates are in YYYY-MM-DD format and align to the benchmark’s market calendar. For US_TREASURY_6M, expect US business dates. Use the date fields from the response as the source of truth for your pipelines.
Q: Are the values percentages or decimals?
A: Percentages per annum. For calculations, convert to decimal by dividing by 100 (and by 12 for simple monthly interest).
Q: How can I detect stale data when requesting multiple symbols?
A: Use the dates map from /latest to read each symbol’s effective date. Do not rely only on the top-level date when mixing categories.
Q: Can I compute monthly candles without storing daily history?
A: Yes. Use /ohlc with period=monthly; the API computes OHLC from the underlying daily series and returns data_points per period.
Q: How do I quickly compare US_TREASURY_6M to another benchmark for a loan?
A: Use /convert with from=US_TREASURY_6M and to=AnotherSymbol. The response includes total_interest, total_payment, rate_spread, and interest_saved based on the latest rates.
If you need the US 6‑month Treasury yield wired into your app today, keep this article open, grab your key, and ship the integration. Register for your API key and explore the MCP docs. You will be reading US_TREASURY_6M, generating time series, and computing spreads in minutes.




