> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vintl.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Yield spread over time

> Returns the spread between two maturities (default 10Y-2Y) with basis points calculated.



## OpenAPI

````yaml /openapi/v1.yaml get /v1/treasury/yields/spread
openapi: 3.1.0
info:
  title: Vintl API
  version: 1.0.0
  description: >
    Point-in-time macro-economic and treasury data API.


    The killer feature: `?as_of=DATE` returns what economic data was known at
    any historical date.

    Requires Pro plan or higher — free plan returns latest data only.
  contact:
    name: Vintl Support
    url: https://vintl.io
  license:
    name: Proprietary
servers:
  - url: https://api.vintl.io
    description: Production
  - url: http://localhost:8080
    description: Local development
security:
  - ApiKeyAuth: []
tags:
  - name: Health
    description: Liveness and readiness probes
  - name: Auth
    description: API key validation and plan info
  - name: Treasury
    description: U.S. Treasury yield curve data (1990-present, never revised)
  - name: Macro
    description: Economic indicators with point-in-time vintage tracking
  - name: Series
    description: Series discovery and metadata
  - name: Insider
    description: SEC Form 4 insider trading data with cluster detection
paths:
  /v1/treasury/yields/spread:
    get:
      tags:
        - Treasury
      summary: Yield spread over time
      description: >-
        Returns the spread between two maturities (default 10Y-2Y) with basis
        points calculated.
      parameters:
        - name: long
          in: query
          schema:
            type: string
            default: 10Y
          description: Long-end maturity
        - name: short
          in: query
          schema:
            type: string
            default: 2Y
          description: Short-end maturity
        - name: curve_type
          in: query
          schema:
            type: string
            default: PAR
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/to'
      responses:
        '200':
          description: Spread time series with basis points
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    example: yield_spread
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/SpreadPoint'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  parameters:
    from:
      name: from
      in: query
      schema:
        type: string
        format: date
      description: Start date (YYYY-MM-DD)
    to:
      name: to
      in: query
      schema:
        type: string
        format: date
      description: End date (YYYY-MM-DD)
  schemas:
    SpreadPoint:
      type: object
      properties:
        trade_date:
          type: string
          format: date-time
          example: '2026-03-24T00:00:00Z'
        long_rate:
          type: string
          example: '4.39'
        short_rate:
          type: string
          example: '3.90'
        spread_bps:
          type: string
          description: Spread in basis points
          example: '49.00'
        long_maturity:
          type: string
          example: 10Y
        short_maturity:
          type: string
          example: 2Y
    Problem:
      type: object
      description: RFC 9457 Problem Details (Content-Type application/problem+json)
      properties:
        type:
          type: string
          format: uri
          example: https://macrodata.dev/errors/not-found
        title:
          type: string
          example: Not Found
        status:
          type: integer
          example: 404
        detail:
          type: string
          example: series 'INVALID' not found
        instance:
          type: string
          example: /v1/series/INVALID
        request_id:
          type: string
          example: req_19d40c11691b60ece4cc73351271260
        field:
          type: string
          description: Which field caused the error (on validation errors)
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: https://macrodata.dev/errors/unauthorized
            title: Unauthorized
            status: 401
            detail: API key is required. Set the X-API-Key header.
            instance: /v1/ping
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key prefixed with `mda_live_sk_`

````