u/Prestigious-Wrap2341

🔥 Hot ▲ 72 r/Python

I built a civic transparency platform with FastAPI that aggregates 40+ government APIs

What My Project Does:

WeThePeople is a FastAPI application that pulls data from 40+ public government APIs to track corporate lobbying, government contracts, congressional stock trades, enforcement actions, and campaign donations across 9 economic sectors. It serves 3 web frontends and a mobile app from a single backend.

Target Audience:

Journalists, researchers, and citizens who want to understand corporate influence on government. Also useful as a reference for anyone building a multi-connector API aggregation platform in Python.

How Python Relates:

The entire backend is Python. FastAPI, SQLAlchemy, and 36 API connectors that each wrap a different government data source.

The dialect compatibility layer (utils/db_compat.py) abstracts SQLite, PostgreSQL, and Oracle differences behind helper functions for date arithmetic, string aggregation, and pagination. The same queries run on all three without changes.

The circuit breaker (services/circuit_breaker.py) is a thread-safe implementation that auto-disables failing external APIs after N consecutive failures, with half-open probe recovery.

The job scheduler uses file-lock based execution to prevent SQLite write conflicts across 35+ automated sync jobs running on different intervals (24h, 48h, 72h, weekly).

All 36 API connectors follow the same pattern. Each wraps a government API (Senate LDA, USASpending, FEC, Congress.gov, SEC EDGAR, Federal Register, OpenFDA, EPA, FARA, and more) with retry logic, caching, and circuit breaker integration.

The claims verification pipeline extracts assertions from text and matches them against 9 data sources using a multi-matcher architecture.

Runs on a $4 monthly Hetzner ARM server. 4.1GB SQLite database in WAL mode. Let's Encrypt TLS via certbot.

Source code: github.com/Obelus-Labs-LLC/WeThePeople

Live: wethepeopleforus.com

reddit.com
u/Prestigious-Wrap2341 — 2 days ago

WeThePeople update: 9 sectors, 14 research tools, AI-generated investigations, and a foreign lobbying tracker

A few weeks ago I shared WeThePeople here — an open-source platform that tracks corporate influence on government using public data. The feedback was great and pushed us to keep building. Here's what's new.

What changed since last time:

  • 9 sectors now (was 7) — added Chemicals and Agriculture alongside Politics, Finance, Health, Tech, Energy, Transportation, Defense
  • 14 research tools on research.wethepeopleforus.com — Patent Explorer, Drug Lookup, Clinical Trials, Insider Trades, FDA Recall Search, Toxic Release Inventory, Foreign Lobbying (FARA), Revolving Door Tracker, Campaign Finance, Gov Salaries, Bill Text Analysis, Market Movers, Regulatory News
  • The Influence Journal at journal.wethepeopleforus.com — AI-generated data investigations with 15 detection patterns. It finds things like STOCK Act violations (members disclosing trades 300+ days late), committee members trading stocks in industries they regulate, and companies getting billions in contracts with zero enforcement
  • FARA foreign lobbying database — 7,000+ registrants, 17,000+ foreign principals, 44,000+ agents loaded from DOJ bulk data. Search by country or firm
  • Story verification pipeline — every AI-generated story gets checked against 9 data sources before publishing
  • Mobile app (Expo) — 40+ screens, all 9 sectors, congressional trades, ZIP lookup, anomalies, chat agent

What the platform tracks:

Every dollar from corporate lobbying to government contracts. For 1,000+ entities across 9 sectors, we pull from 40+ government APIs — Senate LDA filings, USASpending contracts, FEC donations, SEC filings, Congress.gov votes, Federal Register enforcement, OpenFDA, EPA, FARA, and more. Every data point links to its original government source.

Some findings the detection engine surfaced:

  • Rep. Julia Letlow disclosed 13 stock trades 347-363 days late (STOCK Act requires 45 days)
  • Sen. Mullin bought UnitedHealth, Eli Lilly, Raytheon, JPMorgan, Goldman Sachs — every trade in an industry his committees regulate
  • Pfizer: $38B in government contracts, $600 in enforcement penalties
  • Japan has 1,151 registered foreign agents lobbying Washington

Stack: FastAPI + SQLite backend, React 19 frontend, Expo mobile app, hosted on a $4/mo Hetzner ARM server. Fully open source.

Would love feedback on what data sources or features would make this more useful. What government data do you wish was easier to access?

reddit.com
u/Prestigious-Wrap2341 — 2 days ago
▲ 6 r/WhereIsSamAdams+1 crossposts

We The People

I made a platform that tracks corporate lobbying and money as it flows into politics. And it has some other cool features too. I’m definitely still working on it but it’s largely done. Please check out the website or the repo and give me some feedback.

Www.Wethepeopleforus.com

You can find a link to the repo on the webpage

reddit.com
u/Prestigious-Wrap2341 — 13 days ago