# US Treasury Yield Curve API
> Live US Treasury yield curve as an API — US government bond yields across the curve, served from Yahoo Finance. It returns the current yield (in percent) for the 3-month, 2-year, 5-year, 10-year and 30-year Treasuries with their daily change in basis points, the shape of the curve (steep, normal, flat or inverted), and the key spreads traders and economists watch — the 10y-2y and 10y-3m spreads, whose inversion has preceded every modern US recession — plus an inverted flag. Get the whole curve, a single maturity's yield, or the spread between any two maturities. The interest-rate and recession-signal layer for trading, macro-research and dashboard apps. Live, no key, no cache. Distinct from US Treasury fiscal-data APIs (which track national debt and issuance) — this is the live market yield curve.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/yieldcurve-api/..."
```

## Pricing
- **Free** (Free) — 9,000 calls/Mo, 4 req/s
- **Starter** ($10/Mo) — 130,000 calls/Mo, 12 req/s
- **Pro** ($26/Mo) — 650,000 calls/Mo, 35 req/s
- **Desk** ($63/Mo) — 3,300,000 calls/Mo, 100 req/s

## Endpoints

### Curve

#### `GET /v1/curve` — Whole yield curve with spreads, shape and inversion

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/yieldcurve-api/v1/curve"
```

**Response:**
```json
{
    "data": {
        "note": "Treasury constant-maturity yields in percent. A negative 10y-2y or 10y-3m spread (inversion) has historically preceded US recessions.",
        "as_of": "2026-06-08T18:59:53.000Z",
        "curve": [
            {
                "label": "3-Month",
                "years": 0.25,
                "maturity": "3m",
                "yield_pct": 3.628,
                "change_bps": 0.3
            },
            {
                "label": "2-Year",
                "years": 2,
                "maturity": "2y",
                "yield_pct": 3.8,
                "change_bps": -2
            },
            {
                "label": "5-Year",
                "years": 5,
                "maturity": "5y",
                "yield_pct": 4.281,
                "change_bps": 0.1
            },
            {
                "label": "10-Year",
                "years": 10,
                "maturity": "10y",
                "yield_pct": 4.552,
                "change_bps": 1.6
            },
            {
                "label": "30-Year",
                "years": 30,
                "maturity": "30y",
                "yield_pct": 5.024,
                "change_bps": 2.5
            }
        ],
        "shape": "normal",
        "spreads": {
            "10y_2y": 0.752,
            "10y_3m": 0.924,
            "30y_5y": 0.743
        },
        "inverted": false
    },
    "meta": {
        "timestamp": "2026-06-09T03:02:17.914Z",
        "request_id": "c45555
…(truncated, see openapi.json for full schema)
```

### Yield

#### `GET /v1/yield` — A single maturity yield

**Parameters:**
- `maturity` (query, required, string) — Maturity: 3m|2y|5y|10y|30y Example: `10y`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/yieldcurve-api/v1/yield?maturity=10y"
```

**Response:**
```json
{
    "data": {
        "as_of": "2026-06-08T18:59:53.000Z",
        "label": "10-Year",
        "years": 10,
        "maturity": "10y",
        "yield_pct": 4.552,
        "change_bps": 1.6
    },
    "meta": {
        "timestamp": "2026-06-09T03:02:18.067Z",
        "request_id": "0b34638a-064c-40fc-91f9-b1f4b84dfbfe"
    },
    "status": "ok",
    "message": "Yield retrieved successfully",
    "success": true
}
```

### Spread

#### `GET /v1/spread` — Spread between two maturities

**Parameters:**
- `long` (query, optional, string) — Longer maturity Example: `10y`
- `short` (query, optional, string) — Shorter maturity Example: `2y`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/yieldcurve-api/v1/spread?long=10y&short=2y"
```

**Response:**
```json
{
    "data": {
        "long": "10y",
        "short": "2y",
        "inverted": false,
        "spread_bps": 75.2,
        "spread_pct": 0.752,
        "long_yield_pct": 4.552,
        "short_yield_pct": 3.8
    },
    "meta": {
        "timestamp": "2026-06-09T03:02:18.184Z",
        "request_id": "e13a89e3-b2e7-4bac-8a15-62feff0f744f"
    },
    "status": "ok",
    "message": "Spread retrieved successfully",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Service metadata

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/yieldcurve-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "source": "Yahoo Finance US Treasury yield indices (live)",
        "service": "yieldcurve-api",
        "endpoints": {
            "GET /v1/meta": "This document.",
            "GET /v1/curve": "The whole yield curve + spreads, shape and inversion flag.",
            "GET /v1/yield": "A single maturity's yield (maturity=10y|2y|5y|30y|3m).",
            "GET /v1/spread": "Spread between two maturities (long=10y&short=2y)."
        },
        "maturities": [
            "3m",
            "2y",
            "5y",
            "10y",
            "30y"
        ],
        "description": "Live US Treasury yield curve from Yahoo Finance: current yields for the 3-month, 2-year, 5-year, 10-year and 30-year Treasuries with daily change in basis points, the curve shape (steep/normal/flat/inverted), the key 10y-2y and 10y-3m spreads (whose inversion has preceded US recessions) and an inverted flag. Get the whole curve, a single maturity, or any spread. Live, no key. Distinct from US Treasury fiscal-data APIs (debt and issuance) — this is the live market yield curve.",
        "upstream_status": "ok"
    },
    "meta": {
        "timestamp": "2026-06-09T03:02:18.288Z",
        "request_id": "269b7621-b885-4233-a780-620e0c92ca83"
    },
    "status": "ok",
    "message": "Meta",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/yieldcurve-api
OpenAPI spec: https://www.oanor.com/api/yieldcurve-api/openapi.json
