Programming

How I Built Free Apify Actors to Scrape Congressional Stock Trading Data Directly from Government Sources

2026-04-30 20:47:01

Introduction

Accessing the stock trading activities of U.S. Congress members has become a hot topic for transparency, but many aggregators charge hefty fees for data that is actually public domain. After relying on QuiverQuant's API for my personal trading dashboard—paying $30 per month for inconsistent endpoints and occasional errors during market hours—I decided to take matters into my own hands. Over two weekends, I built two Apify actors that scrape Senate and House Periodic Transaction Reports (PTRs) directly from official government websites, providing clean JSON data at roughly one-tenth the cost of commercial alternatives.

How I Built Free Apify Actors to Scrape Congressional Stock Trading Data Directly from Government Sources
Source: dev.to

Why I Built This

The STOCK Act of 2012 requires every member of Congress to disclose most stock trades within 45 days. The data is freely available from two government sources:

Despite being public, most resellers like QuiverQuant charge monthly subscriptions for cleaned and normalized data. My personal dashboard needed per-transaction granularity and stable uptime, which would have required a higher-tier paid plan. Instead, I built my own pipeline using Apify's serverless platform, eliminating subscription costs and giving me full control over the data format.

Output Schema

Both actors normalize every transaction into a consistent JSON object. Here is the structure:

This schema is identical for both Senate and House actors, making it easy to combine datasets or run them independently.

How the Actors Work

Senate Actor

The Senate disclosure system at efdsearch.senate.gov is a Django application that imposes several obstacles:

The actor handles these challenges seamlessly, outputting clean JSON as described above.

How I Built Free Apify Actors to Scrape Congressional Stock Trading Data Directly from Government Sources
Source: dev.to

House Actor

The House provides a simpler structure: a daily ZIP file containing XML files for each disclosure period. The actor:

Because the House data is already machine-readable, the actor runs faster and requires fewer workarounds than the Senate version.

Using the Actors

Both actors are available on Apify:

You can run either one independently or chain them together to get a complete dataset. Each run returns an array of transaction objects, ready for ingestion into your own database or analysis pipeline. The output schema ensures consistency across sources.

Conclusion

By building these two Apify actors, I eliminated the need for expensive third-party APIs while gaining full control over data quality and format. The total cost per run is roughly one-tenth of QuiverQuant's monthly fee, and the data is directly sourced from official government websites—guaranteeing accuracy and timeliness. If you're a developer or investor interested in congressional trading transparency, these actors provide a free, open alternative to commercial data feeds.

Explore

Claude Mythos Uncovers Record 271 Zero-Day Flaws in Firefox Browser Rust 1.97 to Drop Support for Older NVIDIA GPUs and CUDA Drivers Inside the Musk-Altman Legal Battle: Early OpenAI Emails and Corporate Secrets Revealed Crypto Markets Rally as Bitcoin Surges to Two-Month High Amid Regulatory Shifts and Institutional Moves 6 Critical Shifts in OpenAI's Stargate Strategy: From Ownership to Flexible Leasing