Treasury Yields API - Dart/Flutter Client

Treasury Yields provides current and historical US Treasury constant-maturity market yields across the full curve (1-month through 30-year), plus TIPS real yields. Every plan gets today's full nominal curve. Paid plans add history back to 2010, TIPS real yields, day-over-day changes, curve spreads, inversion flags, the curve's shape and breakeven inflation.

pub package License: MIT

This is the Dart/Flutter client for the Treasury Yields API.

Installation

Add this to your pubspec.yaml:

dependencies:
  apiverve_treasuryyields: ^1.2.6

Then run:

dart pub get
# or for Flutter
flutter pub get

Usage

import 'package:apiverve_treasuryyields/apiverve_treasuryyields.dart';

void main() async {
  final client = TreasuryyieldsClient('YOUR_API_KEY');

  try {
    final response = await client.execute({
      'date': '2025-06',
      'type': '10yr'
    });

    print('Status: ${response.status}');
    print('Data: ${response.data}');
  } catch (e) {
    print('Error: $e');
  }
}

Response

{
  "status": "ok",
  "error": null,
  "data": {
    "date": "2026-10-23",
    "yields": {
      "1mo": 4.11,
      "3mo": 4.22,
      "6mo": 4.3,
      "1yr": 4.44,
      "2yr": 4.69,
      "3yr": 4.75,
      "5yr": 4.82,
      "7yr": 4.89,
      "10yr": 5,
      "20yr": 5.37,
      "30yr": 5.33
    },
    "realYields": {
      "5yr": 2.34,
      "7yr": 2.49,
      "10yr": 2.66,
      "20yr": 2.94,
      "30yr": 3.08
    },
    "bills": 4.22,
    "notes": 5,
    "bonds": 5.33,
    "tips": 2.66,
    "frn": 4.22,
    "changes": {
      "bills": {
        "change1d": 0,
        "direction": "unchanged"
      },
      "notes": {
        "change1d": 0.04,
        "direction": "up"
      },
      "bonds": {
        "change1d": 0.04,
        "direction": "up"
      },
      "tips": {
        "change1d": 0.02,
        "direction": "up"
      },
      "frn": {
        "change1d": 0,
        "direction": "unchanged"
      },
      "1mo": {
        "change1d": 0,
        "direction": "unchanged"
      },
      "3mo": {
        "change1d": 0,
        "direction": "unchanged"
      },
      "6mo": {
        "change1d": 0.01,
        "direction": "up"
      },
      "1yr": {
        "change1d": 0.03,
        "direction": "up"
      },
      "2yr": {
        "change1d": 0.04,
        "direction": "up"
      },
      "3yr": {
        "change1d": 0.03,
        "direction": "up"
      },
      "5yr": {
        "change1d": 0.04,
        "direction": "up"
      },
      "7yr": {
        "change1d": 0.03,
        "direction": "up"
      },
      "10yr": {
        "change1d": 0.04,
        "direction": "up"
      },
      "20yr": {
        "change1d": 0.05,
        "direction": "up"
      },
      "30yr": {
        "change1d": 0.04,
        "direction": "up"
      }
    },
    "spread10yr2yr": 0.31,
    "spread10yr3mo": 0.78,
    "spread30yr5yr": 0.51,
    "spread5yr2yr": 0.13,
    "inverted10yr2yr": false,
    "inverted10yr3mo": false,
    "curveShape": "normal",
    "breakevenInflation": {
      "5yr": 2.48,
      "7yr": 2.4,
      "10yr": 2.34,
      "20yr": 2.43,
      "30yr": 2.25
    }
  }
}

API Reference

Authentication

All requests require an API key. Get yours at apiverve.com.

License

MIT License - see LICENSE for details.


Built with Dart for APIVerve

Libraries

apiverve_treasuryyields
Treasury Yields API client for Dart/Flutter