Skip to content
Bank statements

bankstatement.extract

Extract and reconcile transactions from text PDFs for Wells Fargo Advantage Checking, Chase checking and Barclays bank accounts.

POSThttps://api.kanagu.dev/v1/bankstatement/extract
Price
$0.12 per page, on successful calls only
Without a key
10 free calls per IP per UTC day, shared by REST and MCP.
MCP tool
bankstatement.extract at https://api.kanagu.dev/mcp
curl https://api.kanagu.dev/v1/bankstatement/extract \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.wellsfargo.com/assets/pdf/personal/help/tester.pdf"}'
curl https://api.kanagu.dev/v1/bankstatement/extract \
  -H "Authorization: Bearer $KANAGU_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://www.wellsfargo.com/assets/pdf/personal/help/tester.pdf"}'
const res = await fetch("https://api.kanagu.dev/v1/bankstatement/extract", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.KANAGU_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "url": "https://www.wellsfargo.com/assets/pdf/personal/help/tester.pdf"
  }),
});
if (!res.ok) throw new Error((await res.json()).error.message);
const result = await res.json();
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "bankstatement.extract",
    "arguments": {
      "url": "https://www.wellsfargo.com/assets/pdf/personal/help/tester.pdf"
    }
  }
}
Request body
{
  "url": "https://www.wellsfargo.com/assets/pdf/personal/help/tester.pdf"
}
Response · 200
{
  "layout": "wells_fargo_advantage_checking",
  "account": {
    "last4": "2222"
  },
  "currency": "USD",
  "period": {
    "start": "2002-04-03",
    "end": "2002-05-03"
  },
  "balances": {
    "opening": "4721.33",
    "closing": "4830.79"
  },
  "pageCount": 2,
  "transactions": [
    {
      "date": "2002-04-29",
      "description": "Deposit",
      "amount": "31.20",
      "page": 1
    },
    {
      "date": "2002-04-08",
      "description": "Check #5254",
      "amount": "-21.33",
      "page": 2
    },
    "… 25 more"
  ],
  "reconciliation": {
    "status": "reconciled",
    "net": "109.46",
    "calculatedClosing": "4830.79",
    "difference": "0.00"
  },
  "needs_review": false,
  "warnings": []
}

Request body

application/json

Exactly one of these 2 shapes:

1. With base64

base64string (base64, max 6990508 chars)required
Base64-encoded statement PDF

2. With url

urlstring (uri, max 2048 chars)required
Public URL of a statement PDF

Response

200 · application/json

layoutstring | nullrequired
accountobject | nullrequired
currency"USD" | "GBP" | nullrequired
periodobject | nullrequired
balancesobjectrequired
balances.openingstring | nullrequired
balances.closingstring | nullrequired
pageCountinteger (≤ 9007199254740991)required
transactionsarray of objectrequired
transactions[].datestring (date)required
transactions[].descriptionstringrequired
transactions[].amountstringrequired
transactions[].pageinteger (≤ 9007199254740991)required
transactions[].balancestring
reconciliationobjectrequired
reconciliation.status"reconciled" | "mismatch" | "unverified"required
reconciliation.netstringrequired
reconciliation.calculatedClosingstring | nullrequired
reconciliation.differencestring | nullrequired
needs_reviewbooleanrequired
warningsarray of objectrequired
warnings[].codestringrequired
warnings[].pageinteger (≤ 9007199254740991)

Try it

bankstatement.extract

$0.12/page

No key needed · 10 free calls per IP per day

Response

Run the request to see the live response here.

Errors

Errors are JSON {"error":{"code","message"}}. An operation may add its own 400 codes; the message says what to fix.

StatusCode and meaning
400invalid_input

The body does not match the request schema. The message names each field.

400invalid_json

The body is missing or is not valid JSON.

400invalid_idempotency_key

Idempotency-Key must be 1–128 visible ASCII characters.

401invalid_api_key

The Bearer key is missing, malformed, invalid or inactive.

402free_allowance_exhausted

This month's free usage is used up and the account has no subscription. Subscribe from the dashboard, or wait for the next UTC month; Retry-After gives the seconds left.

404not_found

No operation at this path.

409idempotency_conflict

The Idempotency-Key was already used with a different body.

413payload_too_large

JSON bodies may be at most 64 KiB.

429trial_limit

The anonymous trial allows 10 calls per IP per UTC day, shared by REST and MCP. Retry-After gives the seconds left.

500internal_error

The call failed on our side. It is not billed; retry with the same Idempotency-Key.

JSON Schema

Request schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "base64": {
          "type": "string",
          "minLength": 4,
          "maxLength": 6990508,
          "format": "base64",
          "contentEncoding": "base64",
          "pattern": "^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$",
          "description": "Base64-encoded statement PDF"
        }
      },
      "required": [
        "base64"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "maxLength": 2048,
          "format": "uri",
          "description": "Public URL of a statement PDF"
        }
      },
      "required": [
        "url"
      ],
      "additionalProperties": false
    }
  ],
  "examples": [
    {
      "url": "https://www.wellsfargo.com/assets/pdf/personal/help/tester.pdf"
    }
  ],
  "type": "object"
}
Response schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "layout": {
      "type": [
        "string",
        "null"
      ]
    },
    "account": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "last4": {
              "type": "string"
            }
          },
          "required": [
            "last4"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "currency": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "USD",
            "GBP"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "period": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "start": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            },
            "end": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            }
          },
          "required": [
            "start",
            "end"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "balances": {
      "type": "object",
      "properties": {
        "opening": {
          "type": [
            "string",
            "null"
          ]
        },
        "closing": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "opening",
        "closing"
      ],
      "additionalProperties": false
    },
    "pageCount": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    },
    "transactions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
          },
          "description": {
            "type": "string"
          },
          "amount": {
            "type": "string"
          },
          "page": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "balance": {
            "type": "string"
          }
        },
        "required": [
          "date",
          "description",
          "amount",
          "page"
        ],
        "additionalProperties": false
      }
    },
    "reconciliation": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "reconciled",
            "mismatch",
            "unverified"
          ]
        },
        "net": {
          "type": "string"
        },
        "calculatedClosing": {
          "type": [
            "string",
            "null"
          ]
        },
        "difference": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "status",
        "net",
        "calculatedClosing",
        "difference"
      ],
      "additionalProperties": false
    },
    "needs_review": {
      "type": "boolean"
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "page": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "code"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "layout",
    "account",
    "currency",
    "period",
    "balances",
    "pageCount",
    "transactions",
    "reconciliation",
    "needs_review",
    "warnings"
  ],
  "additionalProperties": false
}