# Bank Statement PDF to Categorized Transactions (`seasons-ai/bank-statement-categorizer`) Actor

Bank statement PDF to categorized transactions and CSV, reconciled to the cent against the printed balances. Any bank, digital or scanned. Pay per page.

- **URL**: https://apify.com/seasons-ai/bank-statement-categorizer.md
- **Developed by:** [Stan Lookoff](https://apify.com/seasons-ai) (community)
- **Categories:** AI, Business, Automation
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$15.00 / 1,000 statement pages

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 Categorized Transactions (with Balance Reconciliation)

Turn a bank statement PDF — digital or scanned, any bank — into a clean, categorized transaction list, with proof that no row was missed: every row is checked against the printed running balance, and opening balance + credits − debits is checked against the closing balance, to the cent.

Built for accountants, bookkeepers, lending analysts and FP\&A teams who need statement data in a spreadsheet or ledger.

### What you can do

- **Extract every transaction:** date, description, counterparty, signed amount, debit/credit and running balance — one dataset row each.
- **Categorize automatically:** use the default list (salary, groceries, rent, utilities, software, fees, transfers and more) or pass your own chart of accounts (up to 60 names).
- **Reconcile to the cent:** each row gets a balance check (`ok`, `mismatch` or `unchecked`), each page a status, and the statement `reconciled: true/false`. When a row is missing or misread, the summary says where — for example "expected 6,236.92, printed 6,230.17". A gap at a page break shows up as a brought-forward balance that does not match the previous page.
- **Get a summary:** bank, last 4 digits of the account, currency, statement period, opening/closing balance, total credits and debits, issues found and totals per category.
- **Import anywhere:** `transactions.csv` is ready for Excel, Google Sheets, QuickBooks or Xero.
- **Newest-first statements** are detected and returned oldest-first.

### How to use

1. Paste a public link to one statement PDF into **Statement PDF URL** (max 50 MB). A `data:application/pdf;base64,...` URL also works. The form is prefilled with a 2-page **fictional sample statement** ("Maple Ridge Savings Bank — fictional sample data") so you can try it right away.
2. Optionally set **Max pages** (caps the price), your own **Categories**, and the **Date format** if your statement uses ambiguous dates like 03/04.
3. Start the run. Transactions and the summary row appear in the **Output** tab; the CSV is linked there and in the summary as `csvUrl`.

| Field | Required | Description |
|---|---|---|
| `pdfUrl` | yes | Public link to one statement PDF (max 50 MB), or a `data:application/pdf;base64,...` URL. |
| `maxPages` | no | Process at most this many pages, starting from page 1. Default 20, max 100. |
| `categories` | no | Your own category list or chart of accounts (up to 60 names). `Other` is always added. |
| `dateOrder` | no | `auto` (default), `day-first` or `month-first`. |

### Pricing

You pay per statement page processed. **Pages that could not be read are free, and a run that fails is free.**

| Event | Price |
|---|---|
| Statement page | $0.015 |

| Example | Cost |
|---|---|
| 2-page sample statement | $0.03 |
| Typical 6-page monthly statement | $0.09 |
| 12 monthly statements × 6 pages (one year) | $1.08 |
| 100-page statement (maximum per run) | $1.50 |

Before reading anything, the Actor works out the price from the page count (capped by `maxPages`). If the run's maximum cost is lower than that, it stops without charging and tells you the amount to set.

Available on paid Apify plans.

### Input example

```json
{
  "pdfUrl": "https://example.com/statements/2026-09.pdf",
  "maxPages": 20,
  "categories": ["Revenue", "Payroll", "Rent", "Software", "Travel", "Bank Fees", "Owner Draw"]
}
```

### Output example

From the fictional sample statement. One row per transaction:

```json
{
  "type": "transaction",
  "page": 1,
  "index": 3,
  "date": "2026-09-03",
  "description": "POS FRESHMART GROCERY #112",
  "counterparty": "FreshMart Grocery",
  "amount": -87.43,
  "direction": "debit",
  "balance": 6333.12,
  "category": "Groceries",
  "balanceCheck": "ok",
  "expectedBalance": null
}
```

And one summary row at the end:

```json
{
  "type": "summary",
  "bank": "Maple Ridge Savings Bank (fictional sample)",
  "accountLast4": "4821",
  "currency": "USD",
  "periodStart": "2026-09-01",
  "periodEnd": "2026-09-30",
  "pagesProcessed": 2,
  "transactionCount": 25,
  "openingBalance": 4250,
  "totalCredits": 8172.46,
  "totalDebits": 3549.94,
  "computedClosingBalance": 8872.52,
  "closingBalance": 8872.52,
  "reconciled": true,
  "pages": [{ "page": 1, "status": "ok", "transactions": 13 }, { "page": 2, "status": "ok", "transactions": 12 }],
  "categoryTotals": { "Groceries": { "count": 2, "debits": -199.51, "credits": 0 } },
  "csvUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/transactions.csv?signature=...",
  "priceUsd": 0.03
}
```

### Limits

- One PDF per run, up to 50 MB and 100 pages (`maxPages`, default 20). Longer statements: raise `maxPages` or split the file.
- Up to about 14,000 characters of text per page — well over 100 transaction rows. A page above that is cut, and the summary flags it.
- Up to 60 categories, 60 characters each.
- Balance checks need a running-balance column or printed opening/closing balances. Without them, rows come back `unchecked` and `reconciled` is `null`.
- Password-protected PDFs are not supported.

### Good to know

- Amounts are read as printed and never "fixed": a misread shows up as a balance `mismatch`, so check pages that are not `ok`.
- Categories are assigned by an AI model from the description and counterparty; review them before filing taxes or books.
- The CSV and dataset stay available while your run's storage is kept. Download them to keep a copy.
- Questions or a missing feature? Open an issue on the Actor page.

# Actor input Schema

## `pdfUrl` (type: `string`):

Public link to one bank statement PDF (digital or scanned, any bank, max 50 MB). A data:application/pdf;base64,... URL also works.

## `maxPages` (type: `integer`):

Process at most this many pages (from the first page). You pay per processed page, so this caps the run price.

## `categories` (type: `array`):

Category names to assign, e.g. your chart of accounts (max 60, 60 characters each). Leave empty for the default list: Salary & Payroll Income, Business Income & Sales, Interest & Dividends, Refunds & Reimbursements, Transfers In, Transfers Out, Groceries, Dining & Restaurants, Rent & Mortgage, Utilities, Phone & Internet, Fuel & Transportation, Travel & Lodging, Shopping & Retail, Software & Subscriptions, Office Supplies & Equipment, Professional Services, Advertising & Marketing, Insurance, Healthcare & Pharmacy, Entertainment & Recreation, Education, Charity & Donations, Taxes & Government, Loan & Credit Card Payments, Bank Fees & Charges, Cash Withdrawal, Cash Deposit, Other. 'Other' is always added.

## `dateOrder` (type: `string`):

How to read numeric dates like 03/04. Auto infers it from the statement.

## Actor input object example

```json
{
  "pdfUrl": "https://api.apify.com/v2/key-value-stores/D1uJek9TryGZnnkKt/records/synthetic-statement.pdf?signature=EnDwpmzFEiSV5KK0AVG5",
  "maxPages": 20,
  "dateOrder": "auto"
}
```

# Actor output Schema

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

No description

## `csv` (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 = {
    "pdfUrl": "https://api.apify.com/v2/key-value-stores/D1uJek9TryGZnnkKt/records/synthetic-statement.pdf?signature=EnDwpmzFEiSV5KK0AVG5",
    "maxPages": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("seasons-ai/bank-statement-categorizer").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 = {
    "pdfUrl": "https://api.apify.com/v2/key-value-stores/D1uJek9TryGZnnkKt/records/synthetic-statement.pdf?signature=EnDwpmzFEiSV5KK0AVG5",
    "maxPages": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("seasons-ai/bank-statement-categorizer").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 '{
  "pdfUrl": "https://api.apify.com/v2/key-value-stores/D1uJek9TryGZnnkKt/records/synthetic-statement.pdf?signature=EnDwpmzFEiSV5KK0AVG5",
  "maxPages": 20
}' |
apify call seasons-ai/bank-statement-categorizer --silent --output-dataset

```

## MCP server setup

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

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/yLN3tX0JsPYJ8vYPt/builds/batNOnKwagPsUMWPG/openapi.json
