bankstatement.extract
Extract and reconcile transactions from text PDFs for Wells Fargo Advantage Checking, Chase checking and Barclays bank accounts.
https://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.extractathttps://api.kanagu.dev/mcp- Markdown
- /docs/bankstatement.extract.md
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"
}
}
}{
"url": "https://www.wellsfargo.com/assets/pdf/personal/help/tester.pdf"
}{
"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 | nullrequiredaccountobject | nullrequiredcurrency"USD" | "GBP" | nullrequiredperiodobject | nullrequiredbalancesobjectrequiredbalances.openingstring | nullrequiredbalances.closingstring | nullrequiredpageCountinteger (≤ 9007199254740991)requiredtransactionsarray of objectrequiredtransactions[].datestring (date)requiredtransactions[].descriptionstringrequiredtransactions[].amountstringrequiredtransactions[].pageinteger (≤ 9007199254740991)requiredtransactions[].balancestringreconciliationobjectrequiredreconciliation.status"reconciled" | "mismatch" | "unverified"requiredreconciliation.netstringrequiredreconciliation.calculatedClosingstring | nullrequiredreconciliation.differencestring | nullrequiredneeds_reviewbooleanrequiredwarningsarray of objectrequiredwarnings[].codestringrequiredwarnings[].pageinteger (≤ 9007199254740991)
Try it
Errors
Errors are JSON {"error":{"code","message"}}. An operation may add its own 400 codes; the message says what to fix.
| Status | Code and meaning |
|---|---|
| 400 | invalid_inputThe body does not match the request schema. The message names each field. |
| 400 | invalid_jsonThe body is missing or is not valid JSON. |
| 400 | invalid_idempotency_keyIdempotency-Key must be 1–128 visible ASCII characters. |
| 401 | invalid_api_keyThe Bearer key is missing, malformed, invalid or inactive. |
| 402 | free_allowance_exhaustedThis 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. |
| 404 | not_foundNo operation at this path. |
| 409 | idempotency_conflictThe Idempotency-Key was already used with a different body. |
| 413 | payload_too_largeJSON bodies may be at most 64 KiB. |
| 429 | trial_limitThe anonymous trial allows 10 calls per IP per UTC day, shared by REST and MCP. Retry-After gives the seconds left. |
| 500 | internal_errorThe 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
}