# Bank Statement to CSV/Excel Converter (`docfoundry/bank-statement-converter`) Actor

Convert bank and credit-card statement PDFs to clean CSV and Excel (XLSX). Handles US, UK and EU formats, multi-page tables, debit/credit columns, and Google Drive or Dropbox links. Signed amounts, ISO dates, running balance. Statements are never stored.

- **URL**: https://apify.com/docfoundry/bank-statement-converter.md
- **Developed by:** [Nick Nguyen](https://apify.com/docfoundry) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $40.00 / 1,000 statement processed (per document)s

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## 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 to CSV/Excel Converter

Turn bank and credit-card statement PDFs into a clean, normalized transaction table — download it
as **CSV** or **Excel**, or read it straight from the dataset via API. Built for bookkeepers,
accountants, and anyone reconciling accounts whose bank only offers PDF exports.

### Features

- **Batch conversion**: pass any number of statement PDFs in one run.
- **Normalized output**: ISO dates, signed amounts (negative = money out), running balance,
  detected currency and account number — the same columns for every bank.
- **Deterministic parsing first**: fast, free, and exact for table-style statements.
- **AI fallback for messy layouts** (optional): when a layout defeats the parser, an LLM retries
  the extraction — with a hard cost cap per document, and only if you enable it.
- **CSV + XLSX downloads** in the run's key-value store, plus the full dataset for API users.
- **Zero retention**: your statements are processed in memory and never stored (details below).

### How it works

1. Paste links to your statement PDFs (Google Drive and Dropbox share links work), or put the
   PDFs in one of your key-value stores and pick it in the input. PDFs in that store are **deleted
   as soon as the actor has read them**. No input? The actor converts a bundled synthetic sample so
   you can see the output format.
2. Each PDF is parsed deterministically (text and table extraction). A confidence check —
   do the running balances reconcile with the amounts? — decides whether the optional AI fallback
   is needed.
3. Transactions land in the dataset; `transactions.csv` and `transactions.xlsx` land in the
   run's key-value store, ready to download.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `pdfUrls` | array | `[]` | Links to statement PDFs (Drive and Dropbox share links work). |
| `statementStore` | key-value store | none | One of your key-value stores holding statement PDFs. The actor converts every PDF in it and deletes each one once read; other records are left alone. Empty (and no links) = convert the bundled sample. |
| `dateFormat` | enum | `auto` | `month-first` (US), `day-first` (EU/UK), or `auto` to infer per document. |
| `llmFallback` | boolean | `true` | Retry unparseable layouts with an LLM. Needs an `ANTHROPIC_API_KEY` env var on the actor; skipped silently without one. |
| `llmCostCapCents` | integer | `2` | Hard AI spend ceiling per document, in US cents (max 10). |

```json
{
    "pdfUrls": [
        "https://example.com/statements/2026-09.pdf",
        "https://example.com/statements/2026-10.pdf"
    ],
    "dateFormat": "auto"
}
```

### Output

One dataset record per transaction:

```json
{
    "date": "2026-09-02",
    "description": "ACME PAYROLL DIRECT DEPOSIT",
    "amount": 3120.45,
    "balance": 5570.55,
    "currency": "USD",
    "account": "XXXX-4821",
    "source_document": "2026-09.pdf"
}
```

- `amount` is signed: negative for money out (purchases, fees, withdrawals), positive for money in.
- `balance` is the running balance when the statement prints one, otherwise `null`.
- **Downloads**: `transactions.csv` and `transactions.xlsx` in the run's key-value store
  (Storage → Key-value store tab of the run).

### Pricing

Pay per event: **one charge per processed document** — no subscription, no minimum, and failed
documents are never charged.

| Statements/month | What you pay (at $0.04/document) |
|---|---|
| 12 (one account, monthly) | ~$0.48 |
| 100 | ~$4 |
| 1,000 | ~$40 |

Compare: manual retyping of one statement takes 15–30 minutes; dedicated statement-conversion
SaaS starts around $15/month.

### Limitations (please read)

- **Scanned/image PDFs are not supported.** The PDF must contain selectable text. OCR is on the
  roadmap; a scanned statement currently fails with a clear log message and is not charged.
- Statements with no per-line dates, or layouts where multiple transactions share one line, may
  parse incompletely. The AI fallback usually catches these; when it also fails, the document is
  reported as failed and not charged.
- Ambiguous dates (e.g. `04/05/2026`) are inferred per document; set `dateFormat` explicitly if
  you know your bank's convention.
- Password-protected PDFs must be unlocked before upload.
- Multi-currency statements report the dominant currency for all rows.

### Data privacy (GDPR)

- **Statements in your key-value store are deleted.** A PDF in the store you pick stays there only
  until the actor reads it, then the actor deletes it. If the delete ever fails, the run log says
  so and names the file. Links you paste are only read, never changed.
- Statements are downloaded and processed **in memory** for the duration of the run only.
  The actor never writes your documents anywhere, never logs their contents, and keeps no copy
  after the run ends.
- Extracted transactions are stored **only in your own run's dataset and key-value store**, under
  your Apify account's standard data-retention settings — delete them any time.
- With `llmFallback` enabled and an unparseable layout, the statement's **text** is sent to the
  Anthropic API solely for extraction. Anthropic's API does not train on this data. Set
  `llmFallback: false` for strictly local, deterministic processing.
- No third party other than (optionally) Anthropic ever receives your data.

### Permissions

The actor runs with Apify's **limited permissions**. It can see only the one key-value store you
pick in the input (to read your PDFs and delete each one after reading) and its own run storage.
It cannot list, read, or change anything else in your account. Links you paste are only downloaded.

### Screenshots

**Point it at your statement PDFs:**

![Input form with statement PDF URLs](https://raw.githubusercontent.com/NickNguyenC4/docfoundry-assets/master/bank-statement-converter/input-filled.png)

**Get a clean, normalized transaction table:**

![Output dataset with normalized transactions](https://raw.githubusercontent.com/NickNguyenC4/docfoundry-assets/master/bank-statement-converter/output-dataset.png)

**Download the XLSX and open it straight in Excel:**

![Converted XLSX opened in Excel](https://raw.githubusercontent.com/NickNguyenC4/docfoundry-assets/master/bank-statement-converter/xlsx-in-excel.png)

### Support & roadmap

Found a statement this actor cannot parse? Open an issue on the **Issues** tab — layout reports
directly drive the parser's test suite. Typical response: 1 business day.

Roadmap: OCR for scanned statements, QIF/OFX export, per-account split files.

# Actor input Schema

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

Links to your statement PDFs (Google Drive and Dropbox share links work). Leave this and the store below empty to convert the bundled sample statement and see how the output looks.

## `statementStore` (type: `string`):

Put your statement PDFs in one of your key-value stores (Storage → Key-value stores → create one, then upload the files), and pick it here. The Actor gets access to that store only, converts every PDF in it, and deletes each PDF from the store as soon as it has read it.

## `dateFormat` (type: `string`):

How ambiguous dates like 04/05/2026 should be read. 'Auto' infers it from the document and is right for almost all statements.

## `llmFallback` (type: `boolean`):

When the deterministic parser cannot read a layout, retry with an LLM (needs the ANTHROPIC_API_KEY environment variable; silently skipped without it). The statement text is sent to the Anthropic API for extraction only and is never stored.

## `llmCostCapCents` (type: `integer`):

Hard spend ceiling per document for the AI fallback. Input text is truncated to fit this budget; the fallback is skipped entirely if it cannot. Maximum 10 cents.

## Actor input object example

```json
{
  "pdfUrls": [],
  "dateFormat": "auto",
  "llmFallback": true,
  "llmCostCapCents": 2
}
```

# Actor output Schema

## `transactions` (type: `string`):

Every parsed transaction as normalized JSON records.

## `transactionsCsv` (type: `string`):

The same transactions as a CSV download.

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

Key-value store with the generated .xlsx and .csv files per statement.

# 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": []
};

// Run the Actor and wait for it to finish
const run = await client.actor("docfoundry/bank-statement-converter").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": [] }

# Run the Actor and wait for it to finish
run = client.actor("docfoundry/bank-statement-converter").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": []
}' |
apify call docfoundry/bank-statement-converter --silent --output-dataset

```

## MCP server setup

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

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/CwAjzkgrur8jp42eb/builds/TcJ6a35Qj1b3nwzL2/openapi.json
