US Treasury Data Scraper
Pricing
from $9.00 / 1,000 results
US Treasury Data Scraper
Extract official US national debt figures, federal outlays, and average interest rates directly from the Treasury API into structured financial rows.
Pricing
from $9.00 / 1,000 results
Rating
0.0
(0)
Developer
太郎 山田
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Share
Treasury Fiscal Data Digest | Debt, Rates & Budget Monitor
Build resilient financial data pipelines by extracting official government economic metrics directly from the U.S. Treasury Fiscal Data API. This scraper replaces fragile web scraping scripts and manual checks by connecting directly to the underlying agency feeds. Financial analysts, journalists, and data engineering teams can schedule daily or weekly runs to scrape exact national debt totals, federal budget receipts, and average interest rates without relying on delayed third-party aggregators.
By setting up custom keyword search filters and watchlists, you can filter massive federal datasets to extract only the details your research teams need. Every run returns a clean, summary-first digest row containing precise publication dates, reporting periods, agency identifiers, and numeric totals for debt and outlays.
Whether you are feeding internal compliance dashboards or building public macroeconomic trackers, this tool allows you to automate the extraction of Monthly Treasury Statement data. Seamlessly schedule the scraper to run in the background, ensuring your internal databases always reflect the most current official figures. Export your scraped results easily and integrate reliable federal fiscal data into your broader analytics strategy.
Store Quickstart
What first success looks like:
Key Features
- 🏛️ Government-sourced — Pulls directly from official agency feeds — no third-party aggregators
- ⏱️ Timely digests — Daily/weekly rollups of new filings, rulings, or actions
- 🔍 Keyword watchlists — Flag items matching your compliance/legal watch terms
- 📊 Structured metadata — Agency, date, docket, document type, link — all dataset-ready
- 📡 Webhook alerts — Push to legal/compliance teams the moment new items match watchlist
Use Cases
| Who | Why |
|---|---|
| Developers | Automate recurring data fetches without building custom scrapers |
| Data teams | Pipe structured output into analytics warehouses |
| Ops teams | Monitor changes via webhook alerts |
| Product managers | Track competitor/market signals without engineering time |
Input
| Field | Type | Default | Description |
|---|---|---|---|
| feeds | array | required | One entry per watch target. Each feed produces one summary digest row. Use debt_to_penny for headline debt, avg_interest |
| watchTerms | string | — | Keywords to flag in digest evidence titles, summaries, and source dimensions. Use this for terms like deficit, 10-Year, |
| lookbackDays | integer | 90 | Used to fetch enough history for comparisons and to determine recency for record-setting auction dates. 90 works well fo |
| maxEvidencePerFeed | integer | 10 | Upper bound on nested evidence rows per feed digest. Keep it low for summary-first output; raise it only when you intent |
| delivery | string | "dataset" | dataset stores results in the Apify dataset. webhook posts the digest JSON to webhookUrl. |
| webhookUrl | string | — | POST target for the digest payload. Leave empty for dataset delivery. |
| datasetMode | string | "all" | all emits every feed digest row. action_needed emits only feeds with critical signals or watch-term hits. new_only emits |
| snapshotKey | string | "treasury-fiscal-data-digest-state" | Stable key used to persist seen evidence hashes across recurring runs so changedSinceLastRun and new_only mode stay comp |
Input Example
{"feeds": [{"id": "debt-daily","name": "Debt to the Penny","source": "debt_to_penny"},{"id": "marketable-rates","name": "Marketable Treasury Rates","source": "avg_interest_rates","securityDescriptions": "Treasury Bills,Treasury Notes,Treasury Bonds"},{"id": "monthly-budget","name": "MTS Receipts & Outlays","source": "mts_table_1"},{"id": "record-auctions","name": "Recent Record-Setting Auctions","source": "record_setting_auction","securityTypes": "Bills,Notes","lookbackDays": 180}],"watchTerms": "deficit,10-Year,Treasury Bills","lookbackDays": 180,"maxEvidencePerFeed": 5,"delivery": "dataset","datasetMode": "all","snapshotKey": "treasury-fiscal-data-digest-quickstart","notifyOnNoNew": true,"dryRun": false}
Input Examples
Example: Single-target audit
{"targets": ["example-target-1"],"maxResultsPerTarget": 30}
Example: Bulk portfolio
{"targets": ["target-1","target-2","target-3"],"maxResultsPerTarget": 50,"snapshotKey": "treasury-fiscal-data-digest-state"}
Example: Recurring delta watch
{"targets": ["target-1"],"snapshotKey": "treasury-fiscal-data-digest-state","emitChangedOnly": true}
Output
| Field | Type | Description |
|---|---|---|
meta | object | |
errors | array | |
digests | array | |
digests[].feedId | string | |
digests[].feedName | string | |
digests[].source | string | |
digests[].checkedAt | timestamp | |
digests[].latestRecordDate | timestamp | |
digests[].status | string | |
digests[].changedSinceLastRun | boolean | |
digests[].newEvidenceCount | number | |
digests[].totalEvidenceCount | number | |
digests[].actionNeeded | boolean | |
digests[].headline | string | |
digests[].recommendedAction | string | |
digests[].signalTags | array | |
digests[].watchTermHits | array | |
digests[].summaryMetrics | object | |
digests[].evidence | array | |
digests[].error | null |
Output Example
{"meta": {"feedCount": 4,"totalEvidenceRows": 8,"actionNeededCount": 3,"executiveSummary": {"overallStatus": "action_needed","brief": "3 feed(s) require review; 4 changed since the last run."}},"digests": [{"feedId": "monthly-budget","status": "action_needed","headline": "February MTS: $307.5B deficit; FYTD $1T deficit.","recommendedAction": "Review the widening monthly deficit and update receipts/outlays commentary.","changedSinceLastRun": true,"evidence": [{"title": "Current-month receipts vs outlays (February)","primaryValue": 307501433426.17,"unit": "USD"}]}]}
API Usage
Run this actor programmatically using the Apify API. Replace YOUR_API_TOKEN with your token from Apify Console → Settings → Integrations.
cURL
curl -X POST "https://api.apify.com/v2/acts/taroyamada~treasury-fiscal-data-digest/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \-H "Content-Type: application/json" \-d '{ "feeds": [ { "id": "debt-daily", "name": "Debt to the Penny", "source": "debt_to_penny" }, { "id": "marketable-rates", "name": "Marketable Treasury Rates", "source": "avg_interest_rates", "securityDescriptions": "Treasury Bills,Treasury Notes,Treasury Bonds" }, { "id": "monthly-budget", "name": "MTS Receipts & Outlays", "source": "mts_table_1" }, { "id": "record-auctions", "name": "Recent Record-Setting Auctions", "source": "record_setting_auction", "securityTypes": "Bills,Notes", "lookbackDays": 180 } ], "watchTerms": "deficit,10-Year,Treasury Bills", "lookbackDays": 180, "maxEvidencePerFeed": 5, "delivery": "dataset", "datasetMode": "all", "snapshotKey": "treasury-fiscal-data-digest-quickstart", "notifyOnNoNew": true, "dryRun": false }'
Python
from apify_client import ApifyClientclient = ApifyClient("YOUR_API_TOKEN")run = client.actor("taroyamada/treasury-fiscal-data-digest").call(run_input={"feeds": [{"id": "debt-daily","name": "Debt to the Penny","source": "debt_to_penny"},{"id": "marketable-rates","name": "Marketable Treasury Rates","source": "avg_interest_rates","securityDescriptions": "Treasury Bills,Treasury Notes,Treasury Bonds"},{"id": "monthly-budget","name": "MTS Receipts & Outlays","source": "mts_table_1"},{"id": "record-auctions","name": "Recent Record-Setting Auctions","source": "record_setting_auction","securityTypes": "Bills,Notes","lookbackDays": 180}],"watchTerms": "deficit,10-Year,Treasury Bills","lookbackDays": 180,"maxEvidencePerFeed": 5,"delivery": "dataset","datasetMode": "all","snapshotKey": "treasury-fiscal-data-digest-quickstart","notifyOnNoNew": true,"dryRun": false})for item in client.dataset(run["defaultDatasetId"]).iterate_items():print(item)
JavaScript / Node.js
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });const run = await client.actor('taroyamada/treasury-fiscal-data-digest').call({"feeds": [{"id": "debt-daily","name": "Debt to the Penny","source": "debt_to_penny"},{"id": "marketable-rates","name": "Marketable Treasury Rates","source": "avg_interest_rates","securityDescriptions": "Treasury Bills,Treasury Notes,Treasury Bonds"},{"id": "monthly-budget","name": "MTS Receipts & Outlays","source": "mts_table_1"},{"id": "record-auctions","name": "Recent Record-Setting Auctions","source": "record_setting_auction","securityTypes": "Bills,Notes","lookbackDays": 180}],"watchTerms": "deficit,10-Year,Treasury Bills","lookbackDays": 180,"maxEvidencePerFeed": 5,"delivery": "dataset","datasetMode": "all","snapshotKey": "treasury-fiscal-data-digest-quickstart","notifyOnNoNew": true,"dryRun": false});const { items } = await client.dataset(run.defaultDatasetId).listItems();console.log(items);
Tips & Limitations
- Run daily for active watchlists; weekly for passive monitoring.
- Webhook delivery works well for compliance team Slack channels — include docket URL for 1-click access.
- Use
watchKeywordsgenerously — false positives are cheap to triage, false negatives miss filings. - Pair with
regulatory-change-monitorfor cross-agency coverage. - Archive Dataset rows weekly for long-term compliance evidence retention.
FAQ
How far back does history go?
This actor monitors forward-only — new items since first run. For historical data, use the agency's own search tool.
What timezones are used?
All timestamps are UTC. Use your downstream pipeline to convert to agency-local time if needed.
Does it translate non-English content?
No — original language is preserved. Use downstream translation services if needed.
Is the data official?
Yes — sourced directly from official government websites and feeds. Not a third-party aggregator.
Can I use this for legal research?
For alerting and monitoring, yes. For litigation research, cross-verify with primary sources (agency websites) — this actor is a monitoring tool, not a legal database.
Related Actors
Government & Regulatory cluster — explore related Apify tools:
- EPA Enforcement Digest | ECHO Compliance Risk Monitor — Monitor EPA ECHO all-media facility search, corporate compliance screener, and enforcement case feeds with one summary-first digest row per watched company, facility, or case feed.
- FDA Warning Letters Digest | Summary-First Feed — Monitor public FDA warning letters with one summary-first digest row per configured feed.
- Federal Register Digest | Agency Rule & Notice Monitor — Monitor Federal Register documents — rules, proposed rules, and notices — per configured agency feed.
- Government Contract Award Monitor | Award & Competitor Watch — Monitor public-sector contract award notices for new wins, notable awardees, incumbent recompetes, and competitor signals — one digest row per configured feed without brittle broad crawling.
- Grants.gov Funding Digest | Opportunity Watch & Signal Digest — Monitor Grants.
- NHTSA Vehicle Recall Digest | Recalls + Complaints Watch — Monitor official NHTSA vehicle recall and complaint endpoints for watched model-family, VIN, and manufacturer feeds.
- Product Safety Recall Digest | CPSC + openFDA Alerts — Monitor CPSC saferproducts.
- Regulatory Change Monitor API — Monitor official regulator update feeds, government bulletin pages, and public compliance notices with one action-oriented digest row per monitored source.
- OFAC Sanctions Change Digest | SDN List Monitor — Monitor the OFAC SDN (Specially Designated Nationals) sanctions list for additions and removals.
- Tariff Trade Change Digest | Federal Register + HTS Monitor — Monitor U.
- USPTO Patent Monitor API | JSON + Webhook — Search and monitor US patent filings with multi-source fallback.
- Campaign Finance & Lobbying Digest | FEC + LDA Watch — Monitor official FEC OpenFEC committee reports and LDA.
Cost
Pay Per Event:
actor-start: $0.01 (flat fee per run)dataset-item: $0.003 per output item
Example: 1,000 items = $0.01 + (1,000 × $0.003) = $3.01
No subscription required — you only pay for what you use.
⭐ Was this helpful?
If this actor saved you time, please leave a ★ rating on Apify Store. It takes 10 seconds, helps other developers discover it, and keeps updates free.
Bug report or feature request? Open an issue on the Issues tab of this actor.