Check the setup
- Python 3.10 or newer
- A notebook environment such as Jupyter or Google Colab
- An internet connection
Daily U.S. public debt outstanding for building national-debt monitors and fiscal-dashboard prototypes.
From source to product signal
Fiscal Data reports total public debt outstanding each business day, split into debt held by the public and intragovernmental holdings. Start with the latest 30 records. This is debt outstanding, not a deficit, and other Fiscal Data tables calculate TPDO slightly differently.
Install the packages, then run the notebook cell.
python -m pip install pandas requests
import pandas as pd
import requests
response = requests.get(
"https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/debt_to_penny",
params={
"fields": "record_date,debt_held_public_amt,intragov_hold_amt,tot_pub_debt_out_amt",
"sort": "-record_date",
"page[size]": 30,
},
timeout=30,
)
response.raise_for_status()
debt = pd.DataFrame(response.json()["data"])
debt["record_date"] = pd.to_datetime(debt["record_date"])
debt["tot_pub_debt_out_amt"] = pd.to_numeric(debt["tot_pub_debt_out_amt"])
print(debt.head())Test a useful signal
Test whether daily TPDO can power a bounded national-debt sparkline.
U.S. Department of the Treasury Bureau of the Fiscal Service is a government source. Last verified 2026-08-18. Temporal coverage: 1993-present daily totals with earlier incomplete splits.