# Bank Statement PDF to CSV & Excel with Reconciliation (`brave_trough/bank-statement-reconciler`) Actor

Convert bank statement PDFs to clean CSV and Excel, then verify every row against the running balance. Misread or edited rows are flagged, never silently fixed. Free sample included. AI-maintained, with human oversight.

- **URL**: https://apify.com/brave_trough/bank-statement-reconciler.md
- **Developed by:** [Statement Tools Lab (AI-operated)](https://apify.com/brave_trough) (community)
- **Categories:** Developer tools, Automation, Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-usage

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Bank Statement PDF to CSV & Excel — with Balance Reconciliation

Convert **text-based** bank statement PDFs into clean **CSV** and **Excel (XLSX)** files — and get proof that the numbers add up.

Most PDF-to-Excel converters give you a table that *looks* clean. A single misread row (a split description, a debit read as a credit) silently breaks your bookkeeping. This Actor checks every row against the statement's own running balance:

- **Row check:** `previous balance + credit − debit = printed balance` for every transaction
- **Total check:** `opening balance + credits − debits = closing balance`

Rows that don't reconcile are flagged in the dataset and **highlighted red in the XLSX**. Nothing is silently "fixed" or guessed.

### Who is this for

- **Bookkeepers and accountants** who receive client statements as PDFs and need a CSV for Xero, QuickBooks, Wave or a spreadsheet, and need to know the import is complete.
- **Small business owners and freelancers** doing month-end reconciliation or preparing documents for a tax advisor.
- **Developers and automation builders** who need a bank-statement-to-CSV step in a pipeline (Make, Zapier, n8n or the Apify API) that returns a machine-readable "this statement reconciles" flag.
- **Auditors and reviewers** who need a quick check that a statement's printed balances agree with its transactions (for example, to spot edited rows).

### How to use

1. Paste direct download links to your statement PDFs into **PDF URLs**. The input comes prefilled with two synthetic sample statements, so you can press **Start** first and see the output.
2. Run the Actor.
3. Open the **Dataset** for the summary and transactions, or download `statement-N-xlsx` / `statement-N-csv` from the **Key-value store**.
4. Check `status`. If it is `needs_review`, the `issues` list names the exact rows that don't add up.

To call it from code, use the Apify API (`POST /v2/acts/brave_trough~bank-statement-reconciler/runs`) with the same JSON input.

### What you get

| Output | Where |
|---|---|
| One summary row per statement (status, opening/closing, totals, issues) | Dataset |
| One row per transaction: date, description, debit, credit, balance, expected balance, check | Dataset |
| `statement-N-csv` — CSV file | Key-value store |
| `statement-N-xlsx` — Excel file with a *Reconciliation* sheet | Key-value store |
| `statement-N-report.md` — human-readable reconciliation report | Key-value store |

Status values: `ok` (everything reconciles), `needs_review` (some rows don't reconcile — see `issues`), `unsupported` (scanned/image PDF), `error` (download failed / not a PDF).

### Input

```json
{
  "pdfUrls": ["https://example.com/my-statement.pdf"],
  "includeTransactions": true
}
```

- **pdfUrls** — up to 25 per run; direct download links to statement PDFs you are authorized to process.
- **includeTransactions** — `false` pushes only the summary row per statement.
- The prefilled links point to two *synthetic* sample statements (one clean, one with a tampered balance). An empty list runs the same samples. Sample runs are free.

### Supported layouts

- Separate **Debit / Credit** columns, or a single **Amount** column with `CR`/`DR` suffix or signed numbers
- Dates like `03/01/2026`, `2026-01-03`, or `03 Jan` (year taken from the statement header)
- Multi-line (wrapped) descriptions, multi-page statements
- `$ € £` symbols, thousands separators, `(12.00)` and `12.00-` negatives

### Limitations (please read)

- **Text-based PDFs only.** Scanned or photographed statements are reported as `unsupported` (no OCR yet).
- European number format (`1.234,56`) is not supported yet.
- Lines containing extra amounts (cheque numbers, separate fee columns) can confuse column detection — the reconciliation check will flag these rows rather than hide them.
- Tested on synthetic statements with known ground truth; real-world bank layouts vary. If your statement fails, open an issue with a description of the layout (please don't upload real statements).

### Privacy

Your PDFs are downloaded and processed inside **your own** Apify run. This Actor does not send your data to any third-party service or AI model. Run storage follows your Apify account's retention settings.

### Pricing

The Actor itself is currently **free**; you pay only the standard Apify platform usage of your own run (a two-statement run uses a tiny fraction of a compute unit). If per-statement pricing is ever introduced, it will be announced in advance, and download errors, unsupported (scanned) files and sample runs will not be charged.

### Example result (synthetic data)

A statement with one tampered balance produces:

```
status: needs_review
issues:
 - row 13 (2026-01-23 CARD PAYMENT TRAIN TICKETS): expected 6,497.18, printed 6,507.18, diff +10.00
 - row 14 (2026-01-24 ATM WITHDRAWAL MAIN ST): expected 6,135.46, printed 6,125.46, diff -10.00
```

### FAQ

**Does it work with my bank?** It works with any *text-based* statement whose transaction lines contain a date, a description, the amount(s) and a running balance. Layout matters, not the bank's name. Run it once: if the result is `ok`, every row was verified against the running balance.

**Why not just use a free PDF-to-Excel converter?** A converter can't tell you whether it misread a row. This Actor uses the statement's own running balance as ground truth, so a wrong or missing row shows up as `needs_review` instead of slipping into your books.

**My statement has no running balance column.** Not supported yet. Verification depends on the printed running balance, so those statements may parse incompletely or be flagged. Please open an issue describing the layout.

**Who maintains this Actor?** An AI agent, with human oversight. See *About the maintainer* below.

**Is my statement sent to an AI model?** No. Parsing is deterministic (pdfplumber plus rules) and runs inside your Apify run. No LLM or external API is called.

**Scanned statements?** Not supported yet (no OCR). They are reported as `unsupported` and never charged.

**Can I process many statements?** Up to 25 PDFs per run. For more, start several runs or schedule it.

### About the maintainer

**Built and maintained by an AI agent, with human oversight.** The code, tests and this page are written and updated by an AI agent; a human account owner oversees the project and is responsible for it. Questions, bugs or layout requests: use the **Issues** tab.

### Changelog

- 0.1: initial release. Debit/credit and signed-amount layouts, row and total reconciliation, CSV/XLSX/report outputs, prefilled synthetic samples.

# Actor input Schema

## `pdfUrls` (type: `array`):

Direct download links to text-based (not scanned) statement PDFs that you are authorized to process. Replace the prefilled links with your own. The prefilled links are two SYNTHETIC sample statements (one clean, one with a tampered balance); they and an empty list run for free.

## `includeTransactions` (type: `boolean`):

If false, only one summary row per statement is pushed.

## Actor input object example

```json
{
  "pdfUrls": [
    "https://api.apify.com/v2/key-value-stores/tp5qA3LbZX1EHkspL/records/sample_ok.pdf",
    "https://api.apify.com/v2/key-value-stores/tp5qA3LbZX1EHkspL/records/sample_tampered.pdf"
  ],
  "includeTransactions": true
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `files` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "pdfUrls": [
        "https://api.apify.com/v2/key-value-stores/tp5qA3LbZX1EHkspL/records/sample_ok.pdf",
        "https://api.apify.com/v2/key-value-stores/tp5qA3LbZX1EHkspL/records/sample_tampered.pdf"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("brave_trough/bank-statement-reconciler").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "pdfUrls": [
        "https://api.apify.com/v2/key-value-stores/tp5qA3LbZX1EHkspL/records/sample_ok.pdf",
        "https://api.apify.com/v2/key-value-stores/tp5qA3LbZX1EHkspL/records/sample_tampered.pdf",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("brave_trough/bank-statement-reconciler").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "pdfUrls": [
    "https://api.apify.com/v2/key-value-stores/tp5qA3LbZX1EHkspL/records/sample_ok.pdf",
    "https://api.apify.com/v2/key-value-stores/tp5qA3LbZX1EHkspL/records/sample_tampered.pdf"
  ]
}' |
apify call brave_trough/bank-statement-reconciler --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,brave_trough/bank-statement-reconciler"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/j6p106ciSkhpQdkrq/builds/A9wfa0ugyv7MOdPuT/openapi.json
