Skill Tracer
Skills › Scientific Agent Skills › database-lookup › treasury.md

treasury.md

211 lines · skills/database-lookup/references/treasury.md at 5f2bc03

Open on GitHub
1# US Treasury Fiscal Data API Reference
2

US Treasury Fiscal Data API Reference

Raw lines 1 to 2
3## Overview
4The US Treasury's Fiscal Data API provides machine-readable access to federal financial data: national debt, treasury securities, interest rates, yield curves, revenue, spending, and more. Maintained by the Bureau of the Fiscal Service.
5

Overview

The US Treasury's Fiscal Data API provides machine-readable access to federal financial data: national debt, treasury securities, interest rates, yield curves, revenue, spending, and more. Maintained by the Bureau of the Fiscal Service.

Raw lines 3 to 5
6## Base URL
7```
8https://api.fiscaldata.treasury.gov/services/api/fiscal_service
9```

Base URL

https://api.fiscaldata.treasury.gov/services/api/fiscal_service
Raw lines 6 to 10
11## Authentication
12**No API key required.** The API is fully open and public.

Authentication

No API key required. The API is fully open and public.

Raw lines 11 to 13
14## Rate Limits
15- **No formal rate limits published.**
16- Reasonable use expected; no authentication or throttling documented.
17- For bulk data, use pagination with large page sizes.
19---

Rate Limits

  • No formal rate limits published.
  • Reasonable use expected; no authentication or throttling documented.
  • For bulk data, use pagination with large page sizes.

Raw lines 14 to 20
21## Key Endpoints

Key Endpoints

Raw lines 21 to 22
23### URL Pattern
24All dataset endpoints follow:
25```
26GET /services/api/fiscal_service/{endpoint}?{parameters}
27```

URL Pattern

All dataset endpoints follow:

GET /services/api/fiscal_service/{endpoint}?{parameters}
Raw lines 23 to 28
29### Common Query Parameters (apply to all endpoints)
30| Parameter | Type | Description |
31|-----------|------|-------------|
32| `fields` | string | Comma-separated list of fields to return |
33| `filter` | string | Filter expression: `field:operator:value` (e.g., `record_date:gte:2024-01-01`) |
34| `sort` | string | Sort fields: `field` (asc) or `-field` (desc); comma-separated |
35| `page[number]` | int | Page number (default 1) |
36| `page[size]` | int | Results per page (default 100, max 10000) |
37| `format` | string | `json` (default), `csv`, or `xml` |
39**Filter Operators:**
40`eq` (equals), `lt`, `lte`, `gt`, `gte`, `in` (comma-separated values)
42---

Common Query Parameters (apply to all endpoints)

ParameterTypeDescription
fieldsstringComma-separated list of fields to return
filterstringFilter expression: field:operator:value (e.g., record_date:gte:2024-01-01)
sortstringSort fields: field (asc) or -field (desc); comma-separated
page[number]intPage number (default 1)
page[size]intResults per page (default 100, max 10000)
formatstringjson (default), csv, or xml

Filter Operators: eq (equals), lt, lte, gt, gte, in (comma-separated values)


Raw lines 29 to 43
44### 1. Average interest rates on Treasury securities
46`GET /v2/accounting/od/avg_interest_rates` reports average interest rates on
47outstanding securities. It is not the daily par yield curve. Exchange-rate
48records at `/v1/accounting/od/rates_of_exchange` are also a different dataset.
50Daily Treasury yield curves are provided by the separate
51[Treasury XML feeds](https://home.treasury.gov/treasury-daily-interest-rate-xml-feed).
52Select the par-yield dataset and year from that documentation; preserve maturity,
53date and yield definition rather than substituting average debt interest rates.
55**Example -- Average interest rates on Treasury securities:**
56```
57https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/avg_interest_rates?filter=record_date:gte:2024-01-01&sort=-record_date&page[size]=100
58```
60**Response:**
61```json
63 "data": [
64 {
65 "record_date": "2024-10-31",
66 "security_type_desc": "Marketable",
67 "security_desc": "Treasury Bills",
68 "avg_interest_rate_amt": "5.223",
69 "src_line_nbr": "1",
70 "record_fiscal_year": "2025",
71 "record_fiscal_quarter": "1",
72 "record_calendar_year": "2024",
73 "record_calendar_quarter": "4",
74 "record_calendar_month": "10",
75 "record_calendar_day": "31"
76 }
77 ],
78 "meta": {
79 "count": 100,
80 "labels": { ... },
81 "dataTypes": { ... },
82 "dataFormats": { ... },
83 "total-count": 1234,
84 "total-pages": 13
85 },
86 "links": {
87 "self": "&page%5Bnumber%5D=1&page%5Bsize%5D=100",
88 "first": "&page%5Bnumber%5D=1&page%5Bsize%5D=100",
89 "prev": null,
90 "next": "&page%5Bnumber%5D=2&page%5Bsize%5D=100",
91 "last": "&page%5Bnumber%5D=13&page%5Bsize%5D=100"
92 }
94```
96---

1. Average interest rates on Treasury securities

GET /v2/accounting/od/avg_interest_rates reports average interest rates on outstanding securities. It is not the daily par yield curve. Exchange-rate records at /v1/accounting/od/rates_of_exchange are also a different dataset.

Daily Treasury yield curves are provided by the separate Treasury XML feeds. Select the par-yield dataset and year from that documentation; preserve maturity, date and yield definition rather than substituting average debt interest rates.

Example -- Average interest rates on Treasury securities:

https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/avg_interest_rates?filter=record_date:gte:2024-01-01&sort=-record_date&page[size]=100

Response:

{
  "data": [
    {
      "record_date": "2024-10-31",
      "security_type_desc": "Marketable",
      "security_desc": "Treasury Bills",
      "avg_interest_rate_amt": "5.223",
      "src_line_nbr": "1",
      "record_fiscal_year": "2025",
      "record_fiscal_quarter": "1",
      "record_calendar_year": "2024",
      "record_calendar_quarter": "4",
      "record_calendar_month": "10",
      "record_calendar_day": "31"
    }
  ],
  "meta": {
    "count": 100,
    "labels": { ... },
    "dataTypes": { ... },
    "dataFormats": { ... },
    "total-count": 1234,
    "total-pages": 13
  },
  "links": {
    "self": "&page%5Bnumber%5D=1&page%5Bsize%5D=100",
    "first": "&page%5Bnumber%5D=1&page%5Bsize%5D=100",
    "prev": null,
    "next": "&page%5Bnumber%5D=2&page%5Bsize%5D=100",
    "last": "&page%5Bnumber%5D=13&page%5Bsize%5D=100"
  }
}

Raw lines 44 to 97
98### 2. Debt to the Penny (Daily National Debt)
99```
100GET /v2/accounting/od/debt_to_penny
101```
103**Example -- Debt since 2024:**
104```
105https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/debt_to_penny?filter=record_date:gte:2024-01-01&sort=-record_date&page[size]=10
106```
108**Key Fields:** `record_date`, `tot_pub_debt_out_amt`, `intragov_hold_amt`, `debt_held_public_amt`
110---

2. Debt to the Penny (Daily National Debt)

GET /v2/accounting/od/debt_to_penny

Example -- Debt since 2024:

https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/debt_to_penny?filter=record_date:gte:2024-01-01&sort=-record_date&page[size]=10

Key Fields: record_date, tot_pub_debt_out_amt, intragov_hold_amt, debt_held_public_amt


Raw lines 98 to 111
112### 3. Treasury Securities Auctions
113```
114GET /v1/accounting/od/auctions_query
115```
117**Example -- Recent T-Bill auctions:**
118```
119https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/od/auctions_query?filter=security_type:eq:Bill&sort=-auction_date&page[size]=10
120```
122**Key Fields:** `cusip`, `security_type`, `security_term`, `auction_date`, `issue_date`, `maturity_date`, `high_yield`, `high_discount_rate`, `bid_to_cover_ratio`, `total_accepted`
124---

3. Treasury Securities Auctions

GET /v1/accounting/od/auctions_query

Example -- Recent T-Bill auctions:

https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/od/auctions_query?filter=security_type:eq:Bill&sort=-auction_date&page[size]=10

Key Fields: cusip, security_type, security_term, auction_date, issue_date, maturity_date, high_yield, high_discount_rate, bid_to_cover_ratio, total_accepted


Raw lines 112 to 125
126### 4. Monthly Treasury Statement (Outlays)
127```
128GET /v1/accounting/mts/mts_table_5
129```
131**Example -- Federal outlays:**
132```
133https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/mts/mts_table_5?filter=record_date:gte:2024-01-01&sort=-record_date&page[size]=50
134```
136---

4. Monthly Treasury Statement (Outlays)

GET /v1/accounting/mts/mts_table_5

Example -- Federal outlays:

https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/mts/mts_table_5?filter=record_date:gte:2024-01-01&sort=-record_date&page[size]=50

Raw lines 126 to 137
138### 5. Receipts by Source and Outlays by Function
139```
140GET /v1/accounting/mts/mts_table_9
141```
143**Example:**
144```
145https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/mts/mts_table_9?filter=record_date:gte:2024-01-01&sort=-record_date
146```
148---

5. Receipts by Source and Outlays by Function

GET /v1/accounting/mts/mts_table_9

Example:

https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/mts/mts_table_9?filter=record_date:gte:2024-01-01&sort=-record_date

Raw lines 138 to 149
150### 6. Treasury Reporting Rates of Exchange
151```
152GET /v1/accounting/od/rates_of_exchange
153```
155**Example -- Exchange rates for a quarter:**
156```
157https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/od/rates_of_exchange?filter=record_date:eq:2024-09-30&page[size]=200
158```
160**Key Fields:** `country_currency_desc`, `exchange_rate`, `record_date`, `effective_date`
162---

6. Treasury Reporting Rates of Exchange

GET /v1/accounting/od/rates_of_exchange

Example -- Exchange rates for a quarter:

https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/od/rates_of_exchange?filter=record_date:eq:2024-09-30&page[size]=200

Key Fields: country_currency_desc, exchange_rate, record_date, effective_date


Raw lines 150 to 163
164### 7. Interest Expense on the Debt
165```
166GET /v2/accounting/od/interest_expense
167```
169**Example:**
170```
171https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/interest_expense?filter=record_fiscal_year:eq:2024&sort=-record_date
172```
174---

7. Interest Expense on the Debt

GET /v2/accounting/od/interest_expense

Example:

https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/interest_expense?filter=record_fiscal_year:eq:2024&sort=-record_date

Raw lines 164 to 175
176### 8. Other datasets
178Discover savings-bond and financial-statement endpoints in the current Fiscal
179Data catalogue; their names do not imply interchangeable rate or value series.
180Avoid undocumented guessed paths.

8. Other datasets

Discover savings-bond and financial-statement endpoints in the current Fiscal Data catalogue; their names do not imply interchangeable rate or value series. Avoid undocumented guessed paths.

Raw lines 176 to 181
182## Common Endpoint Paths
184| Endpoint | Description |
185|----------|-------------|
186| `v2/accounting/od/debt_to_penny` | Daily total public debt outstanding |
187| `v2/accounting/od/avg_interest_rates` | Average interest rates on Treasury securities |
188| `v1/accounting/od/auctions_query` | Treasury securities auction results |
189| `v1/accounting/od/rates_of_exchange` | Treasury reporting rates of exchange |
190| `v2/accounting/od/interest_expense` | Interest expense on the public debt |
191| `v1/accounting/mts/mts_table_5` | Outlays of the U.S. Government |
192| `v1/accounting/mts/mts_table_9` | Summary of receipts by source and outlays by function |
193| `v2/accounting/od/debt_outstanding` | Historical debt outstanding (annual) |

Common Endpoint Paths

EndpointDescription
v2/accounting/od/debt_to_pennyDaily total public debt outstanding
v2/accounting/od/avg_interest_ratesAverage interest rates on Treasury securities
v1/accounting/od/auctions_queryTreasury securities auction results
v1/accounting/od/rates_of_exchangeTreasury reporting rates of exchange
v2/accounting/od/interest_expenseInterest expense on the public debt
v1/accounting/mts/mts_table_5Outlays of the U.S. Government
v1/accounting/mts/mts_table_9Summary of receipts by source and outlays by function
v2/accounting/od/debt_outstandingHistorical debt outstanding (annual)
Raw lines 182 to 194
195## Response Format
196All JSON responses share the same envelope:
197- `data`: Array of result objects
198- `meta`: Contains `count`, `total-count`, `total-pages`, field labels and data types
199- `links`: Pagination links (`self`, `first`, `prev`, `next`, `last`)

Response Format

All JSON responses share the same envelope:

  • data: Array of result objects
  • meta: Contains count, total-count, total-pages, field labels and data types
  • links: Pagination links (self, first, prev, next, last)
Raw lines 195 to 200
201## Notes
202- All monetary amounts are returned as strings to preserve precision.
203- Confirm units for each table and field; monthly statement tables are not uniformly in millions.
204- Dates use `YYYY-MM-DD` format in the `record_date` field.
205- For auction analysis, use `auction_date`; `record_date` describes publication.
206- The `filter` parameter supports chaining: `filter=field1:eq:val1,field2:gte:val2`.
207- Use `fields=` to reduce response size by requesting only needed columns.
208- The API documentation and dataset explorer is at: https://fiscaldata.treasury.gov/api-documentation/
209- For Treasury yield curve rates specifically, FRED series `DGS1`, `DGS2`, `DGS5`, `DGS10`, `DGS30` may be more convenient.
211Pagination links may be query fragments. Preserve the original endpoint, filters and fields while replacing page parameters. Use `curl --globoff` for literal square brackets, or encode parameters with `--data-urlencode`.

Notes

  • All monetary amounts are returned as strings to preserve precision.
  • Confirm units for each table and field; monthly statement tables are not uniformly in millions.
  • Dates use YYYY-MM-DD format in the record_date field.
  • For auction analysis, use auction_date; record_date describes publication.
  • The filter parameter supports chaining: filter=field1:eq:val1,field2:gte:val2.
  • Use fields= to reduce response size by requesting only needed columns.
  • The API documentation and dataset explorer is at: https://fiscaldata.treasury.gov/api-documentation/
  • For Treasury yield curve rates specifically, FRED series DGS1, DGS2, DGS5, DGS10, DGS30 may be more convenient.

Pagination links may be query fragments. Preserve the original endpoint, filters and fields while replacing page parameters. Use curl --globoff for literal square brackets, or encode parameters with --data-urlencode.

Raw lines 201 to 211