Web APIs Debt Information
Treasury Security Information
Base URL:
https://www.treasurydirect.gov/NP_WS/
Current Debt Endpoint
/debt/current
Parameters
Parameters | Values Allowed | Example | Description |
---|---|---|---|
callback | All alpha-numeric | myCallback | Used by JSONP to wrap function |
format | xhtml, json, jsonp | xhtml | Determines the format that will be returned in the response |
This URL returns the most recent debt data
Example
https://www.treasurydirect.gov/NP_WS/debt/current
Debt By Date Endpoint
/debt/YYYY/MM/DD
Parameters
Parameters | Values Allowed | Example | Description |
---|---|---|---|
callback | All alpha-numeric | myCallback | Used by JSONP to wrap function |
format | xhtml, json, jsonp | xhtml | Determines the format that will be returned in the response |
This URL returns debt data for a particular date.
Example
https://www.treasurydirect.gov/NP_WS/debt/2014/01/02
Debt Search Endpoint
/debt/search
Parameters
Parameters | Values Allowed | Example | Description |
---|---|---|---|
startDate (required) | Numeric date in format: MM/DD/YYYY | 01/01/1980 | Start date for effective date range. |
endDate (required) | Numeric date in format: MM/DD/YYYY | 01/31/1980 | End date for effective date range. |
callback | All alpha-numeric | myCallback | Used by JSONP to wrap function |
format | xhtml, json, jsonp | xhtml | Determines the format that will be returned in the response |
This URL returns debt data based on the parameters passed.
Example
https://www.treasurydirect.gov/NP_WS/debt/search?startdate=2014-01-01&enddate=2014-02-01
Sample JSON Output
{"effectiveDate":"February 13, 2014 EST","governmentHoldings":4979010546291.80,"publicDebt":12279794967999.13,"totalDebt":17258805514290.93}
Sample XML Output
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><outstandingDebtEntry><governmentHoldings>4979010546291.80</governmentHoldings><effectiveDate>February 13, 2014 EST</effectiveDate><totalDebt>17258805514290.93</totalDebt><publicDebt>12279794967999.13</publicDebt></outstandingDebtEntry>