> ## 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.

> ## Agent Instructions
> The Financial Datasets API is served at https://api.financialdatasets.ai. Authenticate with the `X-API-KEY` header; create keys at https://financialdatasets.ai. Agents can open and fund their own account without a dashboard: see https://docs.financialdatasets.ai/agents.md.
> Tool-using agents can call Financial Datasets without writing code through the hosted MCP server at https://mcp.financialdatasets.ai/.
> The OpenAPI spec at https://financialdatasets.ai/openapi.json is the source of truth for request and response schemas.
> The index of every docs page is at https://docs.financialdatasets.ai/llms.txt. Append .md to any docs URL to get that page as Markdown.

# Treasury Yield Curve API

> The daily US Treasury par yield curve since 1990: 14 tenors from 1-month to 30-year, in percent, one row per business day, updated daily.

### Overview

The Financial Datasets Treasury yield curve API returns the daily US Treasury par yield curve: one row per business day, with one key for each of 14 tenors from 1-month to 30-year. Values are par yields in percent. It covers 1990 to today, updated daily. The data comes directly from authoritative government sources ([data provenance](https://docs.financialdatasets.ai/data-provenance.md)).

You can call it as a REST endpoint with an API key, or from Claude, ChatGPT, Cursor, and other AI apps through the [MCP server](https://docs.financialdatasets.ai/mcp-server.md), or pay per request with [x402](https://docs.financialdatasets.ai/x402.md). [Pricing](https://www.financialdatasets.ai/pricing) starts at \$20.

To get started, please create an account and grab your **API key** 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](https://docs.financialdatasets.ai/guides/pagination.md).

### 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
    }
  ]
}
```

### FAQ

#### Which maturities are included?

14 tenors: 1, 1.5, 2, 3, 4, and 6 months, and 1, 2, 3, 5, 7, 10, 20, and 30 years.

#### Why are some tenors null?

A tenor is `null` when it was not published on that date. 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.

#### How do I get the full history?

Pass a `start_date` in 1990 and follow `next_page_url`. Each page holds up to 100 rows, newest first. With no dates, you get the trailing year.

#### Can an AI agent use this data?

Yes. Claude, ChatGPT, Cursor, and other MCP clients reach it through the [Financial Datasets MCP server](https://docs.financialdatasets.ai/mcp-server.md). An agent with a wallet can also pay per request with [x402](https://docs.financialdatasets.ai/x402.md), with no account.


## 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: Insider Sale Notices
    description: SEC Form 144 notices of proposed insider stock sales
  - name: Politician Trades
    description: Stock trades disclosed by members of Congress
  - 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.
  - name: Search
    description: Search financial documents with one question and get cited passages back
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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.