Skip to main content
GET
/
api
/
treasury
Treasury Data
curl --request GET \
  --url https://api.example.com/api/treasury
{
  "yields": {
    "oneMonth": {},
    "threeMonth": {},
    "twoYear": {},
    "tenYear": {}
  },
  "source": "<string>",
  "record_date": "<string>",
  "fetched_at": "<string>",
  "isLive": true,
  "fallback_at": {},
  "fallback_reason": {}
}

Endpoint

GET /api/treasury
Returns the current U.S. Treasury yield curve with yields across multiple maturities. Data is cached for 24 hours and includes fallback mechanisms for when live data is unavailable.

Response

yields
object
required
Treasury yields across different maturities
source
string
required
Data source identifier (typically “US_TREASURY”)
record_date
string
required
ISO 8601 date of the Treasury data observation
fetched_at
string
required
ISO 8601 timestamp when data was retrieved
isLive
boolean
required
Whether data is live (true) or from fallback snapshot (false)
fallback_at
string | null
ISO 8601 timestamp when fallback data was used (null if live)
fallback_reason
string | null
Explanation for why fallback data was used (null if live)

Example Request

curl https://your-domain.com/api/treasury

Example Response

{
  "yields": {
    "oneMonth": 4.25,
    "threeMonth": 4.35,
    "twoYear": 4.15,
    "tenYear": 4.05
  },
  "source": "US_TREASURY",
  "record_date": "2026-03-02",
  "fetched_at": "2026-03-03T10:30:00Z",
  "isLive": true,
  "fallback_at": null,
  "fallback_reason": null
}

Caching Behavior

  • Cache Duration: 24 hours (86400 seconds)
  • Runtime: Edge
  • Revalidation: Dynamic (force-dynamic) to ensure fresh data within cache window
The endpoint uses a snapshot fallback mechanism when live Treasury data is unavailable. The isLive field indicates whether you’re receiving current data or cached fallback values.

Use Cases

  • Real-time yield curve monitoring
  • Interest rate spread calculations (e.g., 2Y-10Y slope)
  • Base rate input for regime classification
  • Historical yield tracking and analysis

Build docs developers (and LLMs) love