Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
IT Security NachrichtenOnePlus/OxygenOS: Schad-App erhält Root-Zugriff ohne Berechtigungen(24.09.2026 um 23:38 Uhr)
•
IT Security NachrichtenRyuk Member Karen Vardanyan Sentenced to Two Years in U.S. Prison(24.09.2026 um 22:50 Uhr)
•••••
Hacking & PentestingRyuk Member Karen Vardanyan Sentenced to Two Years in U.S. Prison(24.09.2026 um 22:50 Uhr)
•
AI & KI NachrichtenWhy the U.N. Still Matters(24.09.2026 um 23:00 Uhr)
•••
IT Security NachrichtenOnePlus/OxygenOS: Schad-App erhält Root-Zugriff ohne Berechtigungen(24.09.2026 um 23:38 Uhr)
•
IT Security NachrichtenRyuk Member Karen Vardanyan Sentenced to Two Years in U.S. Prison(24.09.2026 um 22:50 Uhr)
•••••
Hacking & PentestingRyuk Member Karen Vardanyan Sentenced to Two Years in U.S. Prison(24.09.2026 um 22:50 Uhr)
•
AI & KI NachrichtenWhy the U.N. Still Matters(24.09.2026 um 23:00 Uhr)
•••
Intelligence View
⚡ tsecurity.de Intelligence

US Treasury API: Track the National Debt in Real-Time with Python (No API Key)

The US national debt just crossed $36 trillion. I wanted to see exactly when it happened, so I built a tracker using the Treasury's free API. Turns out, the US government has a surprisingly good API. The…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

The US national debt just crossed $36 trillion. I wanted to see exactly when it happened, so I built a tracker using the Treasury's free API.



Turns out, the US government has a surprisingly good API.






The API



FiscalData.Treasury.gov — free, no API key, no signup.






Track National Debt






import requests

def get_national_debt(days=10):
url = "https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/debt_to_penny"
params = {
"sort": "-record_date",
"page[size]": days,
"fields": "record_date,tot_pub_debt_out_amt"
}
data = requests.get(url, params=params).json()

for record in data["data"]:
debt = float(record["tot_pub_debt_out_amt"])
print(f"{record["record_date"]}: ${debt/1e12:.4f} trillion")

get_national_debt()
# 2025-03-20: $36.2184 trillion
# 2025-03-19: $36.2157 trillion









Treasury Auction Results



Want to know what interest rate the government is paying on new debt?




def get_auctions(security_type="Bill", limit=5):
url = "https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/od/auctions_query"
params = {
"filter": f"security_type:eq:{security_type}",
"sort": "-auction_date",
"page[size]": limit,
"fields": "auction_date,security_term,high_investment_rate"
}
data = requests.get(url, params=params).json()

for record in data["data"]:
print(f"{record["auction_date"]} | {record["security_term"]} | Rate: {record["high_investment_rate"]}%")

get_auctions()









Government Revenue vs Spending






def monthly_budget():
url = "https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/mts/mts_table_5"
params = {
"sort": "-record_date",
"page[size]": 12,
"fields": "record_date,current_month_net,current_fytd_net"
}
data = requests.get(url, params=params).json()

for record in data["data"][:6]:
net = float(record["current_month_net"]) / 1e9
print(f"{record["record_date"]}: Monthly deficit: ${abs(net):.1f}B")

monthly_budget()









Exchange Rates






def exchange_rates(currency="Euro Zone-Euro"):
url = "https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/od/rates_of_exchange"
params = {
"filter": f"country_currency_desc:eq:{currency}",
"sort": "-record_date",
"page[size]": 6,
"fields": "record_date,exchange_rate"
}
data = requests.get(url, params=params).json()

for record in data["data"]:
print(f"{record["record_date"]}: 1 USD = {record["exchange_rate"]} EUR")

exchange_rates()









All Available Datasets



The Treasury API has 30+ datasets:




































Endpoint What it tracks
debt_to_penny Daily national debt
auctions_query Treasury auction results
mts_table_5 Monthly budget surplus/deficit
rates_of_exchange Exchange rates
avg_interest_rates Average interest on government debt
top_federal Federal spending by agency





This is Part 3 of My Government API Series





  1. SEC EDGAR API — company financials


  2. FRED API — economic data


  3. Treasury API — government debt and spending (this article)



All free. All without API keys (except FRED which takes 30 sec).






What would you track with this data?



I'm thinking about building a public dashboard. What metrics should it show?






Follow for more free API tutorials.

SOC Incident Playbook: Vulnerability Remediation & Verification
Syntax validiert (0 Fehler)
title: Detect Exploitation - US Treasury API: Track the National Debt in Real-Time with Python (No API Key)
id: a073bcd5-df6b-41ed-8f47-a7445db679dc
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-24
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-24"
        description = "YARA Signature for "
    strings:
        $str = "US Treasury API: Track the Nat" ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("US Treasury API Track the National Debt ")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*US Treasury API Track the National Debt *"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "US Treasury API Track the National Debt "
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc
🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich US Treasury API: Track the National Debt.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten US Treasury API: Track the National Debt in Real-Time with Python (No API Key)

Thematisch verwandte Begriffe: Treasury, Track, National, Debt · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-81473 | Dell Rugged Control Center (RCC), versions prior to 5.2.206, contain an …
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel • Rechts: nächster Artikel • unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel TTP ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...
↗ Original-Quelle