微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🏛️

议员交易实时监控与智能预警

Congress Trades Tracker · v1.1.4
专业技能 安全 B 级 作者 armax 公开目录收录
1.3k 下载 0 安装 6.3k 收藏 24 浏览

简介

实时监控美国国会议员股票交易,基于 Quiver Quant API 构建,本地 SQLite 存储,支持 15K 以上交易自动预警,适合关注政治内幕交易与资金流向的用户。

原始描述

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 significan...

通过你的 Agent 添加

点「快速安装」复制一段指令,粘给你正在用的 Agent(Claude Code、Codex、OpenClaw 等),它会自己完成安装。

或者手动安装

Claude Codeunzip -o skill.zip -d ~/.claude/skills/congress-trades-tracker/
其它 Agent解压到它自己的 skills 目录,目录名用 congress-trades-tracker

包里是 SKILL.md 加作者附带的文件,解压后目录名就是技能名。 技能申请的权限由作者决定,装之前请确认它能读什么、能执行什么。

中文使用说明 来自收录源

核心功能

Congress Trades Tracker 是一款专注于美国国会股票交易监控的自动化工具,通过 Quiver Quant 官方 API 实时抓取议员买卖数据,存储于本地 SQLite 数据库,并在检测到超过设定阈值(默认 15,001 美元)的新交易时触发 OpenClaw 消息预警。

显著优点

  1. 权威数据源:直接对接 Quiver Quant,该机构专门收录美国政治人物财务披露数据,数据来源基于官方 STOCK Act 强制申报记录,具有较高公信力。
  2. 本地化部署:完全本地 SQLite 存储,敏感交易数据不落第三方云端,配合 chmod 700 权限控制,隐私可控。
  3. 轻量易用:仅依赖 Python requests 库,无需复杂环境,支持用户级 cron 调度(无需 root),部署门槛低。
  4. 实时预警机制:每分钟轮询,通过文件系统与 OpenClaw 集成,可扩展至多种消息推送渠道。
  5. 灵活配置:支持自定义交易金额阈值、抓取数量、数据库路径等环境变量,适应不同监控强度需求。

潜在局限与风险

  1. 数据源延迟:Quiver Quant 数据基于议员主动披露的 STOCK Act 报告,存在法定延迟(通常 30-45 天),非实时市场数据,无法用于抢先交易。
  2. API 依赖:服务可用性与数据完整性受 Quiver Quant 平台约束,存在单点故障风险;免费/付费 tier 可能有调用频率限制。
  3. 误报与漏报:阈值过滤基于金额区间字段,若 API 返回数据格式异常或区间跨度极大(如 "$1,000,001 - $5,000,000"),精确监控存在难度。
  4. 合规边界:工具本身仅作信息聚合,用户若据此进行交易决策,需自行承担法律与投资风险;工具不涉及交易执行,不构成投资建议。
  5. OpenClaw 集成依赖:预警推送依赖外部 OpenClaw 系统的文件轮询机制,若未正确配置 HEARTBEAT.md 或 cron,可能导致警报丢失。

适合人群

  • 关注政治资金流向的研究者与记者
  • 希望跟踪特定议员持仓变动的个人投资者
  • 合规风控团队(需结合其他数据源交叉验证)
  • 对"政治内幕交易"议题感兴趣的量化分析爱好者

常规风险

  • 环境变量泄露:API key 若硬编码或误提交至版本控制,可能导致密钥泄露;需严格遵循 .profile 或 .env 外部化配置。
  • 文件权限:数据目录权限设置不当可能导致本地其他用户读取敏感交易记录。
  • cron 环境隔离:若未正确加载用户 profile,可能导致 cron 任务运行时 API key 未生效,监控中断。

技能正文


name: congress-trades description: 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.

Congress Trades Tracker

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.

Requirements

Environment Variables

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.

Setup

1. Install Python dependency

pip install requests

2. Set your API key

export QUIVER_API_KEY="your-api-key-here"

3. Schedule with user cron (no sudo needed)

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.

4. Set up OpenClaw alert pickup

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.

How It Works

  1. Scraper runs every minute, fetches latest 200 trades from api.quiverquant.com
  2. Inserts into local SQLite with unique trade_key deduplication
  3. First run initializes DB and reports newest trade
  4. Subsequent runs detect new trades, filter to buys/sells above threshold
  5. Writes formatted alert to data/pending_congress_alert.txt for OpenClaw pickup
  6. Keeps last 50 alerts in data/new_trades.json

Network and Data

  • Only outbound connection: api.quiverquant.com (Quiver Quant API)
  • Storage: local SQLite file + JSON alert files in data/
  • No external endpoints besides the Quiver API
  • Restrict file permissions on data directory (chmod 700 data/)

Alert Format

🏛️ 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

Customization

  • MIN_TRADE_AMOUNT: raise/lower via env var to change alert threshold
  • Fetch limit: change limit=200 in fetch_trades() for broader sweeps
  • Cron frequency: reduce to every 5 or 15 minutes if you prefer less polling

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

political-tradingstock-marketapi-monitoringsqlitecron-automationalert-systemopen-source-data

同类 Skill