US Treasury yield history

$0.005 per call · USDC via x402 · GET /api/treasury-yield-history

Last 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).

Category: Live public data · Tags: treasury yield-curve history interest-rates rates macro bonds time-series

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
daysnumbernoNumber 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
    }
  ]
}
FieldTypeAlways presentIn the example
daysnumberyes30
countnumberyes30
historyarray of objectsyes1 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

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:

Related tools

US Treasury daily yield curve

$0.005 · GET /api/treasury-yield-curve

Latest US Treasury daily constant-maturity yield curve in one object: recordDate plus mo1, mo3, mo6, yr1, yr2, yr3, yr5,…

Treasury yield-curve spreads + inversion

$0.005 · GET /api/yield-curve-spread

Derived 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

$0.005 · GET /api/treasury-avg-rates

Latest average interest rates the US Treasury is paying by security type (Bills, Notes, Bonds, TIPS, FRNs, marketable vs…

FX rate time series

$0.005 · GET /api/fx-timeseries

Daily FX rates between two currencies across a date window using European Central Bank reference rates (via Frankfurter)…

Effective federal funds rate

$0.005 · GET /api/fed-funds

Current 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)

$0.005 · GET /api/fred-release-observations

Bulk-fetch observations for every series in a FRED release in one call. Use it to grab an entire economic report (jobs r…