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

# Historical

> Get the daily US Treasury par yield curve since 1990: 1-month to 30-year yields, one row per business day.

### Overview

The Treasury Yields API lets you pull the daily US Treasury par yield curve, one row per business day with one key per tenor, from 1990 to today.

We source the data directly from authoritative government sources. Values are par yields in percent.

To get started, please create an account and grab your <b>API key</b> at [financialdatasets.ai](https://financialdatasets.ai).

You will use the API key to authenticate your API requests.

### Coverage

| History       | Tenors | Updated |
| ------------- | ------ | ------- |
| 1990 to today | 14     | Daily   |

### Tenors

Each row carries `date` plus these keys: `1_month`, `1_5_month`, `2_month`, `3_month`, `4_month`, `6_month`, `1_year`, `2_year`, `3_year`, `5_year`, `7_year`, `10_year`, `20_year`, `30_year`.

A tenor is `null` when it was not published on that date. These gaps are real, not missing data: the 20-year is absent before October 1993, the 30-year is absent from February 2002 to February 2006, the 2-month starts in October 2018, the 4-month starts in October 2022, and the 1.5-month starts in 2025. Weekends and market holidays have no row.

### Getting Started

There are only 3 steps for making a successful API call:

1. Add your API key to the header of the request as `X-API-KEY`.
2. Optionally add `start_date` and `end_date` (inclusive, `YYYY-MM-DD`). With no dates you get the trailing year.
3. Execute the API request.

Rows come newest first in pages of up to 100. When more rows remain, the response includes a `next_page_url`; request it as-is to get the next page. See the [pagination guide](/guides/pagination).

### Example

```python Treasury Yields theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import requests

# add your API key to the headers
headers = {
    "X-API-KEY": "your_api_key_here"
}

# set parameters
start_date = '2026-01-01'  # optional
end_date = '2026-03-31'    # optional

# create the URL with parameters
url = (
    f'https://api.financialdatasets.ai/macro/yield-curve'
    f'?start_date={start_date}'
    f'&end_date={end_date}'
)

# make API request
response = requests.get(url, headers=headers)

# parse the yield curves from the response
yield_curve = response.json().get('yield_curve')
```

### Example Response

```json theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
{
  "yield_curve": [
    {
      "date": "2026-01-02",
      "1_month": 3.72,
      "1_5_month": 3.71,
      "2_month": 3.66,
      "3_month": 3.65,
      "4_month": 3.62,
      "6_month": 3.58,
      "1_year": 3.47,
      "2_year": 3.47,
      "3_year": 3.55,
      "5_year": 3.74,
      "7_year": 3.95,
      "10_year": 4.19,
      "20_year": 4.81,
      "30_year": 4.86
    }
  ]
}
```


## OpenAPI

````yaml GET /macro/yield-curve
openapi: 3.0.1
info:
  title: Financial Datasets API
  description: >-
    Stock market API with real-time and historical financial data for 27,000+
    tickers over 30+ years. Financial statements, equity prices, insider trades,
    SEC filings, and more.
  version: 1.0.0
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  contact:
    name: API Support
    url: mailto:support@financialdatasets.ai
    email: support@financialdatasets.ai
  termsOfService: https://financialdatasets.ai/terms-of-use
servers:
  - url: https://api.financialdatasets.ai/
    description: Production server
security:
  - X-API-KEY: []
tags:
  - name: Financial Statements
    description: Access to income statements, balance sheets, and cash flow statements
  - name: Market Data
    description: Real-time and historical price data
  - name: Company Information
    description: Company facts like ticker, name, and description
  - name: Earnings
    description: Earnings data and related information
  - name: News
    description: Real-time and historical news articles
  - name: SEC Filings
    description: SEC filings and regulatory documents
  - name: Insider Trades
    description: Insider trading activity and transactions
  - name: Activist Ownership
    description: Activist stakes from SEC Schedule 13D filings, in real time
  - name: Beneficial Ownership
    description: >-
      Holders of more than 5% of a company's shares, from SEC Schedules 13D and
      13G
  - name: Insider Ownership
    description: Insider ownership statements from SEC Forms 3 and 5
  - name: Institutional Holdings
    description: SEC-direct 13F equity holdings of institutional investment managers
  - name: IPOs
    description: >-
      Upcoming IPOs from SEC registration statements (Form S-1), with extracted
      pre-IPO financial statements
  - name: Index Funds
    description: >-
      ETF and index-fund holdings, weights, and the funds that hold a given
      security
  - name: Financial Metrics
    description: Financial ratios, metrics, and key performance indicators
  - name: Macroeconomics
    description: Real-time and historical macroeconomic data like interest rates
  - name: KPIs
    description: Sector-specific operational KPIs extracted from earnings releases.
  - name: Agent Account
    description: Self-serve account creation and funding for AI agents.
paths:
  /macro/yield-curve:
    get:
      tags:
        - Macroeconomics
      summary: Treasury Yields (Historical)
      description: >-
        The daily US Treasury par yield curve, one object per business day with
        one key per tenor, newest first. Values are par yields in percent,
        sourced from authoritative government sources. A tenor is null when it
        was not published on that date.
      operationId: getYieldCurve
      parameters:
        - name: start_date
          in: query
          description: >-
            The first date to return, inclusive, in YYYY-MM-DD format. Defaults
            to one year before end_date when both dates are omitted; omit it
            with an end_date to get all available history through that date.
          required: false
          schema:
            type: string
        - name: end_date
          in: query
          description: >-
            The last date to return, inclusive, in YYYY-MM-DD format. Defaults
            to today.
          required: false
          schema:
            type: string
        - name: cursor
          in: query
          description: >-
            Opaque pagination cursor from a previous response's next_page_url.
            When provided, all other query parameters are ignored: the cursor
            carries the original request's filters. Treat it as opaque; do not
            construct or modify it.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Yield curve response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/YieldCurveResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '402':
          $ref: '#/components/responses/PaymentRequiredError'
        '404':
          $ref: '#/components/responses/NotFoundError'
components:
  schemas:
    YieldCurveResponse:
      type: object
      properties:
        yield_curve:
          type: array
          items:
            $ref: '#/components/schemas/YieldCurve'
        next_page_url:
          type: string
          description: >-
            Absolute URL of the next page of results. Present only when more
            results remain; request it as-is to continue. Each page holds up to
            100 records.
    YieldCurve:
      type: object
      properties:
        date:
          type: string
          description: The business day of the curve in YYYY-MM-DD format.
        1_month:
          type: number
          nullable: true
          description: >-
            1-month par yield in percent. Null when this tenor was not published
            on that date.
        1_5_month:
          type: number
          nullable: true
          description: >-
            1.5-month par yield in percent. Null when this tenor was not
            published on that date.
        2_month:
          type: number
          nullable: true
          description: >-
            2-month par yield in percent. Null when this tenor was not published
            on that date.
        3_month:
          type: number
          nullable: true
          description: >-
            3-month par yield in percent. Null when this tenor was not published
            on that date.
        4_month:
          type: number
          nullable: true
          description: >-
            4-month par yield in percent. Null when this tenor was not published
            on that date.
        6_month:
          type: number
          nullable: true
          description: >-
            6-month par yield in percent. Null when this tenor was not published
            on that date.
        1_year:
          type: number
          nullable: true
          description: >-
            1-year par yield in percent. Null when this tenor was not published
            on that date.
        2_year:
          type: number
          nullable: true
          description: >-
            2-year par yield in percent. Null when this tenor was not published
            on that date.
        3_year:
          type: number
          nullable: true
          description: >-
            3-year par yield in percent. Null when this tenor was not published
            on that date.
        5_year:
          type: number
          nullable: true
          description: >-
            5-year par yield in percent. Null when this tenor was not published
            on that date.
        7_year:
          type: number
          nullable: true
          description: >-
            7-year par yield in percent. Null when this tenor was not published
            on that date.
        10_year:
          type: number
          nullable: true
          description: >-
            10-year par yield in percent. Null when this tenor was not published
            on that date.
        20_year:
          type: number
          nullable: true
          description: >-
            20-year par yield in percent. Null when this tenor was not published
            on that date.
        30_year:
          type: number
          nullable: true
          description: >-
            30-year par yield in percent. Null when this tenor was not published
            on that date.
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: A short error message.
        message:
          type: string
          description: A more detailed error message.
  responses:
    BadRequestError:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Bad Request
            message: Invalid request parameters
    UnauthorizedError:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Unauthorized
            message: Invalid API key provided
    PaymentRequiredError:
      description: The request requires a paid subscription
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Payment Required
            message: >-
              This endpoint requires a paid subscription. Please upgrade your
              plan.
    NotFoundError:
      description: The specified resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Not Found
            message: Ticker XXXX not found
  securitySchemes:
    X-API-KEY:
      type: apiKey
      name: X-API-KEY
      description: API key for authentication.
      in: header

````