Treasury Daily Interest Rate XML Feed

GETTING STARTED

The Treasury Daily Interest Rate Feed provides daily interest rate data in Extensible Markup Language (XML). Our data feed accepts GET requests, returns XML responses, and uses standard HTTP response codes.

For more information about the updates to XML feeds, please see the developer notice on XML data feeds.

DATA FEED URL STRUCTURE

For simplicity and consistency, data feed URLs are formatted with all lower-case characters. Underscores are used as word separators.

The components that make up a full data feed request are below.

BaseURL + Endpoint + Parameters

BASE URL:

https://home.treasury.gov

ENDPOINT:

/resource-center/data-chart-center/interest-rates/pages/xml

PARAMETERS EXAMPLE:

?data=daily_treasury_yield_curve&field_tdr_date_value=2022

FULL REQUEST EXAMPLE:

https://home.treasury.gov/resource-center/data-chart-center/interest-rates/pages/xml?data=daily_treasury_bill_rates&field_tdr_date_value=2022

DATA FEED INDEX

Endpoint

Description

https://home.treasury.gov/resource-center/data-chart-center/interest-rates/pages/xml?data=[value]&field_tdr_date_value=[yyyy]

Returns data for a given year

https://home.treasury.gov/resource-center/data-chart-center/interest-rates/pages/xml?data=[value]&field_tdr_date_value=[all]&page=[xx]

Returns data for all years

https://home.treasury.gov/resource-center/data-chart-center/interest-rates/pages/xml?data=[value]&field_tdr_date_value_month=[yyyymm]

Returns data for a given month

AVAILABLE PARAMETERS

First parameter must be a data key and value; the second parameter is a time-period key and value.

  1. Data

    KEY = data
    VALUE:
    • daily_treasury_yield_curve
    • daily_treasury_bill_rates
    • daily_treasury_long_term_rate
    • daily_treasury_real_yield_curve
    • daily_treasury_real_long_term
  2. Time period - must include the time-period as a second parameter with one of these two options:
    1. field_tdr_date_value to get data for specific year or for all year  

      KEY = field_tdr_date_value
      VALUE

      • yyyy

        Example:
        https://home.treasury.gov/resource-center/data-chart-center/interest-rates/pages/xml?data=[value]&field_tdr_date_value=[yyyy]

        https://home.treasury.gov/resource-center/data-chart-center/interest-rates/pages/xml?data=daily_treasury_yield_curve&field_tdr_date_value=2022

      • all
        KEY = page
        VALUE = xxx (number)

         

        Example:

        https://home.treasury.gov/resource-center/data-chart-center/interest-rates/pages/xml?data=[value]&field_tdr_date_value=[all]&page =[xxx]

        https://home.treasury.gov/resource-center/data-chart-center/interest-rates/pages/xml?data=daily_treasury_yield_curve&field_tdr_date_value=all&page=24

        An XML feed is available for retrieving all records, which you can use with pagination to return all data for a given interest rate type for “all” time periods. You can use the value “all” and a page number to retrieve the data. 

        Pagination (only available for the time period of "all")

        The data feed pagination uses a zero-based index, meaning that the pagination begins on page 0. If you call pagination, you must start at page zero (page=0) and make the increment. The first 300 rows or page zero (page=0) will return by default if you do not request pagination.

        To loop through all pages, increments page number by one until there is no data inside the "<entry>" tag. Looping through years is possible by using the start year in the data below to loop through years to obtain a record of a specific time or for all time.
         

        Data Availability
         

        Interest Rate Type  Available From
        Daily Treasury Par Yield Curve Rates 1990
        Daily Treasury Bill Rates 2002
        Daily Treasury Long-Term Rates 2000
        Daily Treasury Par Real Yield Curve Rates 2003
        Daily Treasury Real Long-Term Rates 2000

         

      • field_tdr_date_value_month to get data for a given month

        KEY = field_tdr_date_value_month
        VALUE
        •    yyyymm

        Example:
        https://home.treasury.gov/resource-center/data-chart-center/interest-rates/pages/xml?data=[value]&field_tdr_date_value_month=[yyyymm]

        https://home.treasury.gov/resource-center/data-chart-center/interest-rates/pages/xml?data=daily_treasury_yield_curve&field_tdr_date_value_month=202204

DATA MODEL

The data in this feed using the OData Entity Data Model (EDM) datatypes. For more information, visit https://www.odata.org/documentation/odata-version-2-0/overview.

Primitive Types

Literal Form

Example

Null
Represents the absence of a value

null

Example 1: null

Edm.Binary
Represent fixed- or variable- length binary data

binary'[A-Fa-f0-9][A-Fa-f0-9]*' OR X '[A-Fa-f0-9][A-Fa-f0-9]*' NOTE: X and binary are case sensitive. Spaces are not allowed between binary and the quoted portion. Spaces are not allowed between X and the quoted portion. Odd pairs of hex digits are not allowed.

Example 1: X'23AB' Example 2: binary'23ABFF'

Edm.Boolean
Represents the mathematical concept of binary-valued logic

true | false

Example 1: true Example 2: false

Edm.Byte
Unsigned 8-bit integer value

[0-9]+

Example 1: 255

Edm.DateTime
Represents date and time with values ranging from 12:00:00 midnight, January 1, 1753 A.D. through 11:59:59 P.M, December 9999 A.D.

datetime'yyyy-mm-ddThh:mm[:ss[.fffffff]]' NOTE: Spaces are not allowed between datetime and quoted portion. datetime is case-insensitive

Example 1: datetime'2000-12-12T12:00'

Edm.Decimal
Represents numeric values with fixed precision and scale. This type can describe a numeric value ranging from negative 10^255 + 1 to positive 10^255 -1

[0-9]+.[0-9]+M|m

Example 1:
2.345M

Edm.Double
Represents a floating point number with 15 digits precision that can represent values with approximate range of ± 2.23e -308 through ± 1.79e +308

[0-9]+ ((.[0-9]+) | [E[+ | -][0-9]+])d

Example 1: 1E+10d Example 2: 2.029d Example 3: 2.0d

Edm.Single
Represents a floating point number with 7 digits precision that can represent values with approximate range of ± 1.18e -38 through ± 3.40e +38

[0-9]+.[0-9]+f

Example 1: 2.0f

Edm.Guid
Represents a 16-byte (128-bit) unique identifier value

guid'dddddddd-dddd-dddd-dddd-dddddddddddd' where each d represents [A-Fa-f0-9]

Example 1: guid'12345678-aaaa-bbbb-cccc-ddddeeeeffff'

Edm.Int16
Represents a signed 16-bit integer value

[-][0-9]+

Example 1: 16 Example 2: -16

Edm.Int32
Represents a signed 32-bit integer value

[-] [0-9]+

Example 1: 32 Example 2: -32

Edm.Int64
Represents a signed 64-bit integer value

[-] [0-9]+L

Example 1: 64L Example 2: -64L

Edm.SByte
Represents a signed 8-bit integer value

[-] [0-9]+

Example 1: 8 Example 2: -8

Edm.String
Represents fixed- or variable-length character data

'<any UTF-8 character>' Note: See definition of UTF8-char in [RFC3629]

Example 1: 'Hello OData'

Edm.Time
Represents the time of day with values ranging from 0:00:00.x to 23:59:59.y, where x and y depend upon the precision

time'<timeLiteral>' timeLiteral = Defined by the lexical representation for dayTimeDuration in http://www.w3.org/TR/xmlschema11-2/#dayTimeDuration

Example 1: PT13H20M

Edm.DateTimeOffset
Represents date and time as an Offset in minutes from GMT, with values ranging from 12:00:00 midnight, January 1, 1753 A.D. through 11:59:59 P.M, December 9999 A.D

datetimeoffset'<dateTimeOffsetLiteral>' dateTimeOffsetLiteral = Defined by the lexical representation for datetime (including timezone offset) at http://www.w3.org/TR/xmlschema-2

Example 1: 2002-10-10T17:00:00Z

DAILY TREASURY RATES XML DATA STRUCTURE

1) DAILY TREASURY PAR YIELD CURVE RATES

2) DAILY TREASURY BILL RATES

3) DAILY TREASURY LONG-TERM RATES

4) DAILY TREASURY REAL PAR YIELD CURVE RATES

5) DAILY TREASURY REAL LONG-TERM RATES