Track US congress member and politician stock trades in real-time using the Quiver Quant API. Syncs trades to a local SQLite database, detects new significant trades above 15K, and sends alerts via OpenClaw messaging. Only requires Python with the requests library and a QUIVER_API_KEY environment variable. Use when setting up congressional trade monitoring, politician stock trade alerts, insider trading surveillance, or tracking what senators and representatives are buying and selling.
Monitor US congressional stock trades via Quiver Quant API, store in a local SQLite database, and alert on new significant trades. Requires Python requests library and a Quiver Quant API key.
requests (pip install requests)| Variable | Required | Default | Description |
|---|---|---|---|
| QUIVER_API_KEY | Yes | — | Quiver Quant API token |
| CONGRESS_DB_PATH | No | data/congress_trades.db | SQLite database path |
| MIN_TRADE_AMOUNT |
| No |
| 15001 |
| Minimum trade amount to trigger alerts |
Set these in your shell profile, .env file, or cron environment. Never hard-code API keys in the script.
pip install requests
export QUIVER_API_KEY="your-api-key-here"
Add your env vars to ~/.profile or a .env file sourced by your shell, then add the cron entry:
crontab -e
# Add this line (uses env vars from your profile):
* * * * * . "$HOME/.profile" && /usr/bin/python3 /path/to/scripts/scraper.py >> /path/to/logs/scraper.log 2>&1
Never inline API keys directly in crontab entries.
Add to your HEARTBEAT.md:
## Check for congress trade alerts
- Read `congress_trades/data/pending_congress_alert.txt` — if it has content, send the alert to the user, then delete the file.
Or create an OpenClaw cron job (every 5 min) to check and forward alerts.
api.quiverquant.comdata/pending_congress_alert.txt for OpenClaw pickupdata/new_trades.jsonapi.quiverquant.com (Quiver Quant API)data/chmod 700 data/)🏛️ 3 new congress trade(s) detected:
🟢 PURCHASE: Nancy Pelosi (D) [Rep]
$NVDA — $1,000,001 - $5,000,000
Trade: 2026-02-10 | Reported: 2026-02-14
🔴 SALE: Dan Crenshaw (R) [Rep]
$MSFT — $15,001 - $50,000
Trade: 2026-02-09 | Reported: 2026-02-14
limit=200 in fetch_trades() for broader sweeps