Get Treasury Interest Rates
treasury_get_interest_ratesAverage interest rates Treasury pays on its outstanding securities by security type. Answers "what is the government's cost of borrowing?" Covers every type Treasury reports — marketable issues, non-marketable series, and the aggregate totals — and which types it reports changes over the years, so omit security_type to see the ones a given period carries. Rates are percentages, not basis points. Updated monthly (end-of-month records). Mode "latest" returns the most recent month's rates for all or one security type; "series" returns a time history, staging the result as a DataCanvas table when canvas_id is set or the range matches more than 200 rows — read the table's column schema with treasury_dataframe_describe, then run SQL over it with treasury_dataframe_query.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | "latest" returns the most recent month's rates. "series" returns a time range. | latest |
| end_date | No | ISO 8601 end date for mode=series. Defaults to today. | |
| canvas_id | No | Set any non-empty value to stage mode=series results as a DataCanvas table for SQL analysis — the value only requests staging; the server picks the table name. Staging also happens on its own when a series matches more than 200 rows. The assigned name (df_XXXXX_XXXXX) comes back in the output canvas_id; pass it to treasury_dataframe_describe, then treasury_dataframe_query. Requires CANVAS_PROVIDER_TYPE=duckdb. | |
| start_date | No | ISO 8601 start date for mode=series (YYYY-MM-DD, must be end-of-month for meaningful results). | |
| security_type | No | Filter to one security type, matched exactly against the security_desc field — full case and punctuation, as in "Treasury Inflation-Protected Securities (TIPS)". Omit for every type in the period, which is how to read the set of types on offer; the response names them when a filter matches nothing. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cap | No | The preview cap applied to the inline series array. | |
| error | No | Present when the call failed. Absent on success. | |
| rates | No | Interest rate records, newest first. Whole in mode=latest — a month is a bounded set. In mode=series an inline preview of at most 20 rows; compare its length against total_records to detect the cap, and reach the rest through canvas_id when one is returned. | |
| shown | No | Series rows returned inline. | |
| notice | No | Guidance when no records match (where the requested security type does have records, or the types the most recent month carries, or the empty date range), when the inline series is a preview, or when the series was staged as a DataCanvas table. | |
| canvas_id | No | DuckDB table name (df_XXXXX_XXXXX) holding the staged series. Pass it to treasury_dataframe_describe for the column schema, then use it as the FROM target in treasury_dataframe_query SQL. Absent when nothing was staged. | |
| truncated | No | True when the inline series array holds fewer rows than were retrieved. | |
| as_of_date | No | Most recent record date returned (YYYY-MM-DD). | |
| total_records | No | In mode=latest, the number of rows in rates. In mode=series, the full upstream match — larger than rates.length whenever the preview cap applied. | |
| canvas_expires_at | No | ISO 8601 expiry for the canvas dataframe. |