US Treasury yield history
GET /api/treasury-yield-historyLast N business days of US Treasury constant-maturity yields, oldest→newest. Send GET /api/treasury-yield-history with no required fields (1 optional) and pay $0.005 per call over x402 or MPP (there is no free tier). It returns a JSON object with days, count and history.
Source: FRED DGS* series (St. Louis Fed), public domain. ?days=30 (1-250, default 30).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
days | number | no | Number of business days, 1-250 (default 30) |
Example request
curl -i "https://agent402.tools/api/treasury-yield-history?days=30"
Without payment this returns HTTP 402 Payment Required with the exact price for treasury-yield-history; any x402 v2 or MPP client pays it and retries.
Example response
{
"days": 30,
"count": 30,
"history": [
{
"recordDate": "2026-05-01",
"yr2": 4.71,
"yr10": 4.46
}
]
}
| Field | Type | Always present | In the example |
|---|---|---|---|
days | number | yes | 30 |
count | number | yes | 30 |
history | array of objects | yes | 1 item in the example |
From an MCP client
catalog.call {
"slug": "treasury-yield-history",
"params": {
"days": 30
}
}
The hosted connector at https://agent402.tools/mcp needs a payment for treasury-yield-history; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.
Errors and behavior
- Every field is optional. An input the tool rejects returns an HTTP 4xx whose body carries
error,tool,expected,requiredandexample. - A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement is cancelled when the tool fails. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A prepaid card-credits key issued earlier (
Authorization: Bearer a402_...) also pays it. - A
POSTwith a JSON body to /api/treasury-yield-history is served as this GET, with the body as the input. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB is not replayed).
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/treasury-yield-history?days=30");
Part of these workflows
US Treasury yield history is one step in this skill pack, each sold as a single call:
- Macro dashboard refresh - The full macro + crypto dashboard in one call: 5 FRED series, 5 Treasury reads, yield-curve spread, crypto market/trending/global, and live gas - the 14-tool basket recurring buyers refresh every cycle, bundled below its a la carte price.
Related tools
US Treasury daily yield curve
GET /api/treasury-yield-curveLatest US Treasury daily constant-maturity yield curve in one object: recordDate plus mo1, mo3, mo6, yr1, yr2, yr3, yr5,…
Treasury yield-curve spreads + inversion
GET /api/yield-curve-spreadDerived 2s10s and 3m10y Treasury yield-curve spreads (in basis points) plus a boolean recession-signal flag when the cur…
Average interest rates on Treasury securities
GET /api/treasury-avg-ratesLatest average interest rates the US Treasury is paying by security type (Bills, Notes, Bonds, TIPS, FRNs, marketable vs…
FX rate time series
GET /api/fx-timeseriesDaily FX rates between two currencies across a date window using European Central Bank reference rates (via Frankfurter)…
Effective federal funds rate
GET /api/fed-fundsCurrent effective federal funds rate (current, as of date, in percent) plus a trailing N-day history of {date, value}. S…
FRED bulk release observations (v2)
GET /api/fred-release-observationsBulk-fetch observations for every series in a FRED release in one call. Use it to grab an entire economic report (jobs r…