api-ninjas-com Treasury Yield API

Current and historical U.S. Treasury yield curve: nominal Constant Maturity Treasury (CMT) par yields (1 month to 30 years), the real (TIPS) yield curve, and Treasury bill rates, with precomputed 2s10s / 3m10s / 5s30s spreads and a yield-curve inversion flag. Data sourced from the U.S. Department of the Treasury.

Operations 2

GET /v1/treasuryyield Get the current (or a specific day's) Treasury yield curve #
GET /v1/treasuryyieldhistorical Get a historical Treasury yield time series #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/api-ninjas-com:api-ninjas-com-treasury-yield-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

api-ninjas-com-treasury-yield-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Ninjas Treasury Yield API
  description: 'Combined OpenAPI specification for every API Ninjas endpoint. Requests go to https://api.api-ninjas.com with an `X-Api-Key` header; get a free key at https://api-ninjas.com/register. Human-readable docs: https://api-ninjas.com/api. Index for LLMs: https://api-ninjas.com/llms.txt.'
  version: 1.0.0
  contact:
    name: API Ninjas
    url: https://api-ninjas.com
  license:
    name: Proprietary
servers:
- url: https://api.api-ninjas.com
  description: API Ninjas Production
security:
- ApiKeyAuth: []
tags:
- name: Treasury Yield
  description: 'Current and historical U.S. Treasury yield curve: nominal Constant Maturity Treasury (CMT) par yields (1 month to 30 years), the real (TIPS) yield curve, and Treasury bill rates, with precomputed 2s10s / 3m10s / 5s30s spreads and a yield-curve inversion flag. Data sourced from the U.S. Department of the Treasury.'
paths:
  /v1/treasuryyield:
    get:
      summary: Get the current (or a specific day's) Treasury yield curve
      description: 'Returns the US Treasury yield curve for one day, latest by default: par, real (TIPS) or bill rates with spreads. For a date range use /treasuryyieldhistorical. Deep history is premium.'
      operationId: getTreasuryYield
      tags:
      - Treasury Yield
      parameters:
      - name: type
        in: query
        required: false
        description: 'Curve type: par (default), real, bill, or all (combined; premium).'
        schema:
          type: string
          enum:
          - par
          - real
          - bill
          - all
          default: par
      - name: date
        in: query
        required: false
        description: Business day (YYYY-MM-DD). Defaults to latest. Deep past dates are premium.
        schema:
          type: string
      - name: format
        in: query
        required: false
        description: json (default) or csv.
        schema:
          type: string
          enum:
          - json
          - csv
          default: json
      responses:
        '200':
          description: The yield curve for the requested type and date.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TreasuryYieldResponse'
      security:
      - ApiKeyAuth: []
  /v1/treasuryyieldhistorical:
    get:
      summary: Get a historical Treasury yield time series
      description: Returns a Treasury yield time series over a date range for the par, real or bill curve, for one `maturity` or, with premium, the whole curve. For a single day use /treasuryyield.
      operationId: getTreasuryYieldHistorical
      tags:
      - Treasury Yield
      parameters:
      - name: type
        in: query
        required: false
        description: 'Curve type: par (default), real, or bill.'
        schema:
          type: string
          enum:
          - par
          - real
          - bill
          default: par
      - name: maturity
        in: query
        required: false
        description: Single maturity code (e.g. year_10, week_13). Omit for full-curve history (premium).
        schema:
          type: string
      - name: start_date
        in: query
        required: false
        description: Start of range (YYYY-MM-DD).
        schema:
          type: string
      - name: end_date
        in: query
        required: false
        description: End of range (YYYY-MM-DD).
        schema:
          type: string
      - name: format
        in: query
        required: false
        description: json (default) or csv.
        schema:
          type: string
          enum:
          - json
          - csv
          default: json
      responses:
        '200':
          description: Historical time series for the requested maturity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TreasuryYieldHistoricalResponse'
      security:
      - ApiKeyAuth: []
components:
  schemas:
    TreasuryYieldHistoricalResponse:
      type: object
      properties:
        type:
          type: string
          example: par
        maturity:
          type: string
          example: year_10
        data:
          type: array
          items:
            type: object
            properties:
              date:
                type: string
                example: '2026-08-10'
              rate_pct:
                type: number
                example: 4.72
              discount_rate:
                type:
                - number
                - 'null'
                description: Bank discount rate percent (bill curve only).
              rates:
                type: object
                description: 'Full-curve mode: maps each maturity to its yield percent.'
                additionalProperties:
                  type:
                  - number
                  - 'null'
                example:
                  year_2: 4.25
                  year_10: 4.72
                  year_30: 5.25
            description: A time-series point, oldest first. For a single maturity each item is { date, rate_pct } (bills also include discount_rate). In full-curve mode each item is { date, rates }.
        next:
          type:
          - string
          - 'null'
    TreasuryYieldResponse:
      type: object
      properties:
        date:
          type: string
          example: '2026-08-10'
        type:
          type: string
          example: par
        rates:
          type: object
          description: 'An object mapping each maturity to its yield percent. A maturity not published on a given day is null. The available maturity keys depend on type: par has all 14 maturities (month_1 to year_30); real has year_5, year_7, year_10, year_20 and year_30; bill has week_4 to week_52, each an object with coupon_equivalent and discount_rate.'
          properties:
            month_1:
              type:
              - number
              - 'null'
              description: 1-month yield percent.
              example: 3.79
            month_1_5:
              type:
              - number
              - 'null'
              description: 1.5-month yield percent.
              example: 3.8
            month_2:
              type:
              - number
              - 'null'
              description: 2-month yield percent.
              example: 3.84
            month_3:
              type:
              - number
              - 'null'
              description: 3-month yield percent.
              example: 3.89
            month_4:
              type:
              - number
              - 'null'
              description: 4-month yield percent.
              example: 3.91
            month_6:
              type:
              - number
              - 'null'
              description: 6-month yield percent.
              example: 4
            year_1:
              type:
              - number
              - 'null'
              description: 1-year yield percent.
              example: 4.04
            year_2:
              type:
              - number
              - 'null'
              description: 2-year yield percent.
              example: 4.25
            year_3:
              type:
              - number
              - 'null'
              description: 3-year yield percent.
              example: 4.31
            year_5:
              type:
              - number
              - 'null'
              description: 5-year yield percent.
              example: 4.41
            year_7:
              type:
              - number
              - 'null'
              description: 7-year yield percent.
              example: 4.56
            year_10:
              type:
              - number
              - 'null'
              description: 10-year yield percent.
              example: 4.72
            year_20:
              type:
              - number
              - 'null'
              description: 20-year yield percent.
              example: 5.25
            year_30:
              type:
              - number
              - 'null'
              description: 30-year yield percent.
              example: 5.25
          additionalProperties:
            type:
            - object
            - 'null'
            description: Treasury bill rate for this tenor (bill curve; keys week_4, week_6, week_8, week_13, week_17, week_26, week_52).
            properties:
              coupon_equivalent:
                type:
                - number
                - 'null'
                description: Coupon-equivalent (investment) yield percent.
              discount_rate:
                type:
                - number
                - 'null'
                description: Bank discount rate percent.
          example:
            year_2: 4.25
            year_10: 4.72
            year_30: 5.25
        spread_2y10y:
          type: number
          example: 0.47
        spread_3m10y:
          type: number
          example: 0.83
        spread_5y30y:
          type: number
          example: 0.84
        curve_inverted:
          type: boolean
          example: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
externalDocs:
  description: API Ninjas documentation
  url: https://api-ninjas.com/api