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

# Get Treasury Rates

> [OpenAPI JSON Spec](/docs/output/v1_macro_treasury-rates_get.json)
Retrieve US Treasury rates data for different maturities over time

**Feature Overview**
Get historical treasury rates including 1M, 2M, 3M, 6M, 1Y, 2Y, 3Y, 5Y, 7Y, 10Y, 20Y, and 30Y rates.

**Main Use Cases**
- **Interest Rate Analysis**: Track treasury rate changes over time
- **Investment Research**: Analyze yield curve movements and trends
- **Economic Analysis**: Monitor economic indicators through treasury rates
- **Portfolio Management**: Use rates for bond portfolio strategy
- **Risk Assessment**: Evaluate interest rate risk across different maturities

**Response Data Structure**

Each rate record includes:
- **date**: Rate date (YYYY-MM-DD format)
- **month1**: 1 Month treasury rate
- **month2**: 2 Month treasury rate
- **month3**: 3 Month treasury rate
- **month6**: 6 Month treasury rate
- **year1**: 1 Year treasury rate
- **year2**: 2 Year treasury rate
- **year3**: 3 Year treasury rate
- **year5**: 5 Year treasury rate
- **year7**: 7 Year treasury rate
- **year10**: 10 Year treasury rate
- **year20**: 20 Year treasury rate
- **year30**: 30 Year treasury rate

**Usage Examples**

1. **Get latest treasury rates**:
No parameters needed

2. **Get rates from specific date**:
`?start_time=1745971200`

3. **Get rates for date range**:
`?start_time=1745971200&end_time=1748563200`



## OpenAPI

````yaml /api-reference/openapi.json get /v1/macro/treasury-rates
openapi: 3.0.0
info:
  contact: {}
  description: >-
    Welcome to Arrays!


    Arrays is a unified financial data layer for both financial institutions and
    retail users, delivering comprehensive market data across crypto and equity
    markets. Our datasets cover fundamentals, ETFs, options, crypto, and more.


    Visit [arrays.org](https://arrays.org) to request an API key and start your
    free trial. You can explore our full API offerings in the documentation
    below.


    For any questions regarding APIs or pricing, please contact
    support@arrays.org.
  title: Arrays API
  version: '1.0'
servers:
  - url: https://data-tools.prd.arrays.org/api
security: []
paths:
  /v1/macro/treasury-rates:
    get:
      tags:
        - Macro
      summary: Get Treasury Rates
      description: >-
        [OpenAPI JSON Spec](/docs/output/v1_macro_treasury-rates_get.json)

        Retrieve US Treasury rates data for different maturities over time


        **Feature Overview**

        Get historical treasury rates including 1M, 2M, 3M, 6M, 1Y, 2Y, 3Y, 5Y,
        7Y, 10Y, 20Y, and 30Y rates.


        **Main Use Cases**

        - **Interest Rate Analysis**: Track treasury rate changes over time

        - **Investment Research**: Analyze yield curve movements and trends

        - **Economic Analysis**: Monitor economic indicators through treasury
        rates

        - **Portfolio Management**: Use rates for bond portfolio strategy

        - **Risk Assessment**: Evaluate interest rate risk across different
        maturities


        **Response Data Structure**


        Each rate record includes:

        - **date**: Rate date (YYYY-MM-DD format)

        - **month1**: 1 Month treasury rate

        - **month2**: 2 Month treasury rate

        - **month3**: 3 Month treasury rate

        - **month6**: 6 Month treasury rate

        - **year1**: 1 Year treasury rate

        - **year2**: 2 Year treasury rate

        - **year3**: 3 Year treasury rate

        - **year5**: 5 Year treasury rate

        - **year7**: 7 Year treasury rate

        - **year10**: 10 Year treasury rate

        - **year20**: 20 Year treasury rate

        - **year30**: 30 Year treasury rate


        **Usage Examples**


        1. **Get latest treasury rates**:

        No parameters needed


        2. **Get rates from specific date**:

        `?start_time=1745971200`


        3. **Get rates for date range**:

        `?start_time=1745971200&end_time=1748563200`
      parameters:
        - description: Start time (Unix timestamp in seconds)
          example: 1745971200
          in: query
          name: start_time
          schema:
            type: integer
            format: int64
        - description: End time (Unix timestamp in seconds)
          example: 1748563200
          in: query
          name: end_time
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/model.APIResponse'
                  - properties:
                      data:
                        items:
                          $ref: '#/components/schemas/model.TreasuryRate'
                        type: array
                    type: object
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/model.APIResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/model.APIResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    model.APIResponse:
      properties:
        data: {}
        error:
          $ref: '#/components/schemas/model.APIError'
        metadata: {}
        pagination: {}
        request_id:
          type: string
        success:
          type: boolean
      type: object
    model.TreasuryRate:
      properties:
        date:
          description: Date in YYYY-MM-DD format
          type: string
        month1:
          description: 1 Month rate
          type: number
        month2:
          description: 2 Month rate
          type: number
        month3:
          description: 3 Month rate
          type: number
        month6:
          description: 6 Month rate
          type: number
        year1:
          description: 1 Year rate
          type: number
        year10:
          description: 10 Year rate
          type: number
        year2:
          description: 2 Year rate
          type: number
        year20:
          description: 20 Year rate
          type: number
        year3:
          description: 3 Year rate
          type: number
        year30:
          description: 30 Year rate
          type: number
        year5:
          description: 5 Year rate
          type: number
        year7:
          description: 7 Year rate
          type: number
      type: object
    model.APIError:
      properties:
        code:
          example: RESOURCE_NOT_FOUND
          type: string
        details:
          items:
            $ref: '#/components/schemas/model.APIErrorDetail'
          type: array
        docs_url:
          type: string
        examples:
          items:
            type: string
          type: array
        hint:
          type: string
        message:
          example: The requested resource was not found.
          type: string
        suggestions:
          items:
            type: string
          type: array
      type: object
    model.APIErrorDetail:
      properties:
        field:
          type: string
        got:
          type: string
        reason:
          type: string
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: 'API Key authentication. Example: "your-api-key-here"'
      in: header
      name: X-API-Key
      type: apiKey

````