refund-radar
Scan bank statements to detect recurring charges, flag suspicious transactions, identify duplicates and fees, draft refund request templates, and generate an interactive HTML audit report.
Triggers
- - "scan my bank statement for refunds"
- "analyze my credit card transactions"
- "find recurring charges in my statement"
- "check for duplicate or suspicious charges"
- "help me dispute a charge"
- "generate a refund request"
- "audit my subscriptions"
Workflow
1. Get Transaction Data
Ask user for bank/card CSV export or pasted text. Common sources:
- - Apple Card: Wallet → Card Balance → Export
- Chase: Accounts → Download activity → CSV
- Mint: Transactions → Export
- Any bank: Download as CSV from transaction history
Or accept pasted text format:
CODEBLOCK0
2. Parse and Normalize
Run the parser on their data:
CODEBLOCK1
Or for pasted text:
CODEBLOCK2
The parser auto-detects:
- - Delimiter (comma, semicolon, tab)
- Date format (YYYY-MM-DD, DD/MM/YYYY, MM/DD/YYYY)
- Amount format (single column or debit/credit)
- Currency
3. Review Recurring Charges
Tool identifies recurring subscriptions by:
- - Same merchant >= 2 times in 90 days
- Similar amounts (within 5% or $2)
- Consistent cadence (weekly, monthly, yearly)
- Known subscription keywords (Netflix, Spotify, etc.)
Output shows:
- - Merchant name
- Average amount and cadence
- Last charge date
- Next expected charge
4. Flag Suspicious Charges
Tool automatically flags:
| Flag Type | Trigger | Severity |
|---|
| Duplicate | Same merchant + amount within 2 days | HIGH |
| Amount Spike |
> 1.8x baseline, delta > $25 | HIGH |
| New Merchant | First time + amount > $30 | MEDIUM |
| Fee-like | Keywords (FEE, ATM, OVERDRAFT) + > $3 | LOW |
| Currency Anomaly | Unusual currency or DCC | LOW |
5. Clarify with User
For flagged items, ask in batches of 5-10:
- - Is this charge legitimate?
- Should I mark this merchant as expected?
- Do you want a refund template for this?
Update state based on answers:
CODEBLOCK3
6. Generate HTML Report
Report saved to INLINECODE0
Copy template.html structure. Sections:
- - Summary: Transaction count, total spent, recurring count, flagged count
- Recurring Charges: Table with merchant, amount, cadence, next expected
- Unexpected Charges: Flagged items with severity and reason
- Duplicates: Same-day duplicate charges
- Fee-like Charges: ATM fees, FX fees, service charges
- Refund Templates: Ready-to-copy email/chat/dispute messages
Features:
- - Privacy toggle (blur merchant names)
- Dark/light mode
- Collapsible sections
- Copy buttons on templates
- Auto-hide empty sections
7. Draft Refund Requests
For each flagged charge, generate three template types:
- - Email: Formal refund request
- Chat: Quick message for live support
- Dispute: Bank dispute form text
Three tone variants each:
- - Concise (default)
- Firm (assertive)
- Friendly (polite)
Templates include:
- - Merchant name and date
- Charge amount
- Dispute reason based on flag type
- Placeholders for card last 4, reference number
Important: No apostrophes in any generated text.
CLI Reference
CODEBLOCK4
Files Written
| Path | Purpose |
|---|
| INLINECODE1 | Learned preferences, merchant history |
| INLINECODE2 |
Interactive audit report |
|
~/.refund_radar/reports/YYYY-MM.json | Raw analysis data |
Privacy
- - No network calls. Everything runs locally.
- No external APIs. No Plaid, no cloud services.
- Your data stays on your machine.
- Privacy toggle in reports. Blur merchant names with one click.
Requirements
- - Python 3.9+
- No external dependencies
Repository
https://github.com/andreolf/refund-radar
refund-radar
扫描银行对账单以检测重复收费、标记可疑交易、识别重复项和费用、起草退款请求模板,并生成交互式HTML审计报告。
触发词
- - 扫描我的银行对账单以查找退款
- 分析我的信用卡交易
- 查找对账单中的重复收费
- 检查重复或可疑收费
- 帮我争议一笔费用
- 生成退款请求
- 审计我的订阅
工作流程
1. 获取交易数据
要求用户提供银行/信用卡CSV导出文件或粘贴文本。常见来源:
- - Apple Card:钱包 → 卡片余额 → 导出
- Chase:账户 → 下载活动 → CSV
- Mint:交易 → 导出
- 任何银行:从交易历史下载CSV
或接受粘贴文本格式:
2026-01-03 Spotify -11.99 USD
2026-01-15 工资 +4500 USD
2. 解析与标准化
对用户数据运行解析器:
bash
python -m refund_radar analyze --csv statement.csv --month 2026-01
或针对粘贴文本:
bash
python -m refund_radar analyze --stdin --month 2026-01 --default-currency USD
解析器自动检测:
- - 分隔符(逗号、分号、制表符)
- 日期格式(YYYY-MM-DD、DD/MM/YYYY、MM/DD/YYYY)
- 金额格式(单列或借方/贷方)
- 货币
3. 审查重复收费
工具通过以下方式识别重复订阅:
- - 同一商户在90天内出现 >= 2次
- 金额相似(在5%或2美元以内)
- 固定周期(每周、每月、每年)
- 已知订阅关键词(Netflix、Spotify等)
输出显示:
- - 商户名称
- 平均金额和周期
- 最近一次收费日期
- 预计下次收费
4. 标记可疑收费
工具自动标记:
| 标记类型 | 触发条件 | 严重程度 |
|---|
| 重复项 | 同一商户+金额在2天内 | 高 |
| 金额异常 |
> 1.8倍基准线,差额 > 25美元 | 高 |
| 新商户 | 首次出现+金额 > 30美元 | 中 |
| 类似费用 | 关键词(费用、ATM、透支)+ > 3美元 | 低 |
| 货币异常 | 异常货币或DCC | 低 |
5. 与用户确认
针对标记项目,分批询问5-10项:
- - 这笔收费是否合法?
- 是否应将此商户标记为预期?
- 是否需要为此生成退款模板?
根据回答更新状态:
bash
python -m refund_radar mark-expected --merchant Costco
python -m refund_radar mark-recurring --merchant Netflix
6. 生成HTML报告
报告保存至 ~/.refund_radar/reports/YYYY-MM.html
复制 template.html 结构。章节:
- - 摘要:交易数量、总支出、重复收费数量、标记数量
- 重复收费:表格包含商户、金额、周期、预计下次
- 意外收费:标记项目及严重程度和原因
- 重复项:同日重复收费
- 类似费用:ATM费用、外汇费用、服务费
- 退款模板:可复制的邮件/聊天/争议消息
功能:
- - 隐私切换(模糊商户名称)
- 深色/浅色模式
- 可折叠章节
- 模板上的复制按钮
- 自动隐藏空章节
7. 起草退款请求
针对每个标记收费,生成三种模板类型:
- - 邮件:正式退款请求
- 聊天:用于实时支持的快捷消息
- 争议:银行争议表单文本
每种三种语气变体:
模板包含:
- - 商户名称和日期
- 收费金额
- 基于标记类型的争议原因
- 卡片后四位、参考编号的占位符
重要:所有生成文本中不得使用撇号。
CLI参考
bash
分析对账单
python -m refund_radar analyze --csv file.csv --month 2026-01
从标准输入分析
python -m refund_radar analyze --stdin --month 2026-01 --default-currency CHF
将商户标记为预期
python -m refund_radar mark-expected --merchant Amazon
将商户标记为重复
python -m refund_radar mark-recurring --merchant Netflix
列出预期商户
python -m refund_radar expected
重置学习状态
python -m refund_radar reset-state
导出月度数据
python -m refund_radar export --month 2026-01 --out data.json
写入文件
| 路径 | 用途 |
|---|
| ~/.refundradar/state.json | 学习偏好、商户历史 |
| ~/.refundradar/reports/YYYY-MM.html |
交互式审计报告 |
| ~/.refund_radar/reports/YYYY-MM.json | 原始分析数据 |
隐私
- - 无网络调用。 一切在本地运行。
- 无外部API。 无Plaid、无云服务。
- 您的数据保留在您的机器上。
- 报告中的隐私切换。 一键模糊商户名称。
要求
仓库
https://github.com/andreolf/refund-radar