US Treasury Data Scraper avatar

US Treasury Data Scraper

Pricing

from $9.00 / 1,000 results

Go to Apify Store
US Treasury Data Scraper

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 Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

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

WhoWhy
DevelopersAutomate recurring data fetches without building custom scrapers
Data teamsPipe structured output into analytics warehouses
Ops teamsMonitor changes via webhook alerts
Product managersTrack competitor/market signals without engineering time

Input

FieldTypeDefaultDescription
feedsarrayrequiredOne entry per watch target. Each feed produces one summary digest row. Use debt_to_penny for headline debt, avg_interest
watchTermsstringKeywords to flag in digest evidence titles, summaries, and source dimensions. Use this for terms like deficit, 10-Year,
lookbackDaysinteger90Used to fetch enough history for comparisons and to determine recency for record-setting auction dates. 90 works well fo
maxEvidencePerFeedinteger10Upper bound on nested evidence rows per feed digest. Keep it low for summary-first output; raise it only when you intent
deliverystring"dataset"dataset stores results in the Apify dataset. webhook posts the digest JSON to webhookUrl.
webhookUrlstringPOST target for the digest payload. Leave empty for dataset delivery.
datasetModestring"all"all emits every feed digest row. action_needed emits only feeds with critical signals or watch-term hits. new_only emits
snapshotKeystring"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

FieldTypeDescription
metaobject
errorsarray
digestsarray
digests[].feedIdstring
digests[].feedNamestring
digests[].sourcestring
digests[].checkedAttimestamp
digests[].latestRecordDatetimestamp
digests[].statusstring
digests[].changedSinceLastRunboolean
digests[].newEvidenceCountnumber
digests[].totalEvidenceCountnumber
digests[].actionNeededboolean
digests[].headlinestring
digests[].recommendedActionstring
digests[].signalTagsarray
digests[].watchTermHitsarray
digests[].summaryMetricsobject
digests[].evidencearray
digests[].errornull

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 ApifyClient
client = 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 watchKeywords generously — false positives are cheap to triage, false negatives miss filings.
  • Pair with regulatory-change-monitor for 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.

Government & Regulatory cluster — explore related Apify tools:

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.