# Bank Statement PDF to Transactions (balance-verified) (`hypnotic_swirl/bank-statement-pdf-to-transactions`) Actor

Turn text-based bank statement PDFs into clean transaction rows. Each row is proven against the running balance, so you know which rows to trust.

- **URL**: https://apify.com/hypnotic_swirl/bank-statement-pdf-to-transactions.md
- **Developed by:** [Mudit Chauhan](https://apify.com/hypnotic_swirl) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 results

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 PDF to Transactions (balance-verified)

Give it links to text-based bank statement PDFs. You get one clean row per transaction: date, narration, reference, debit, credit and balance. Every row is checked against the running balance, so you can see which rows are proven correct and which need a human look.

### Why use it

- **Verified rows.** The tool recomputes each balance from the previous one. A row is marked `verified: true` only if the arithmetic matches. Generic PDF converters just copy text and silently merge columns or drop wrapped rows.
- **Layout-independent.** It finds the date, amount and balance columns from the data itself, so it does not need a template per bank.
- **Password-protected PDFs** are supported (enter the password once, it is applied to every file and never stored in the output).
- **Pay for what you get.** Optionally return only verified rows and be charged only for those.

### Input

| Field | Meaning |
|---|---|
| `pdfUrls` | Direct http(s) links to PDFs. Max 25 MB each, max 50 per run. Must open without login. |
| `password` | Optional, for protected PDFs. Secret field. |
| `includeUnverified` | Default on. Turn off to return (and pay for) only proven rows. |

### Output

- **Dataset:** one item per transaction: `sourceUrl, date (YYYY-MM-DD), valueDate, narration, ref, debit, credit, balance, verified, page`.
- **Key-value store `REPORT`:** one entry per statement with `ok`, an error code if it failed (`PASSWORD_REQUIRED`, `WRONG_PASSWORD`, `SCANNED_PDF`, `NOT_A_PDF`, `DOWNLOAD_FAILED`, ...), `rowsFound`, `rowsVerified`, opening and closing balance, date range, totals and warnings.

### What it does not do (be aware before you buy)

- **Scanned or photographed statements are not supported** (no OCR). They fail with `SCANNED_PDF` and cost nothing.
- Tested on 10 synthetic test statements (several layouts, one password-protected, one with a watermark; all rows correct except one row flagged as unverifiable, see below) and on one real, password-protected ICICI statement (672 of 672 rows verified). **Other banks are not yet confirmed.** If your bank's PDF parses badly, you will see it in the `verified` flags and `REPORT`; please send the issue on the Actor's Issues tab and it will be fixed.
- Currency is not detected; amounts are returned as printed.
- If a statement prints no opening balance, the oldest row's debit/credit direction cannot be proven, so that row is returned as `verified: false`.

### Privacy

Files are fetched, parsed in memory and not kept by the Actor. Apify stores each run's dataset and report according to your plan's retention settings, so delete the run when you are done with sensitive data. Use temporary links where you can.

### Pricing

Pay per event: you are charged per transaction row returned. Rows that fail, and statements that error, are not charged.

# Actor input Schema

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

Direct http(s) links to text-based bank statement PDFs (not scanned images). Max 25 MB per file, max 50 files per run. Links must open without a login, for example a temporary or signed link.

## `password` (type: `string`):

Used for every file if they are password-protected. It is never stored or written to the output.

## `includeUnverified` (type: `boolean`):

If off, only rows proven by the running balance are returned and charged. Unverified rows are still counted in the REPORT.

## Actor input object example

```json
{
  "includeUnverified": true
}
```

# Actor output Schema

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

Transaction rows: date, narration, reference, debit, credit, balance and whether each row is verified against the running balance.

## `report` (type: `string`):

Per-statement summary: success or error code, rows found and verified, opening and closing balance, warnings.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("hypnotic_swirl/bank-statement-pdf-to-transactions").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 = {}

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

```

## MCP server setup

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

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/z43g58z3cg1NxKU27/builds/cvCT6GY5R9qIpxA0d/openapi.json
