Stuur uw API-sleutel als Bearer-token in de Authorization-header. Wij gebruiken API-sleutels; geen OAuth in v1.
API voor het extraheren van bankafschriften
REST API om PDF-bankafschriften om te zetten in gestructureerde JSON. 99,9%+ van de transacties correct geïdentificeerd, automatisch terugbetaald bij mislukking.
$ curl https://api.bankstatementlab.com/v1/extractions \
-H "Authorization: Bearer bsl_live_..." \
-F "file=@statement.pdf" Extractie van bankafschriften
Extraheer transacties, saldi en metagegevens uit elke PDF.
Gestructureerde JSON-uitvoer
Voorspelbaar schema in 10 ondersteunde talen.
99,9%+ van de transacties correct geïdentificeerd
Automatische terugbetaling bij mislukking. Geen kosten voor mislukte extracties.
Synchrone en asynchrone modi
Synchronisch voor kleine PDF's, asynchroon + polling voor grote batches.
Codevoorbeelden
Integreer in elke taal. Voorbeelden hieronder.
$ curl https://api.bankstatementlab.com/v1/extractions \
-H "Authorization: Bearer bsl_live_..." \
-F "file=@statement.pdf" const form = new FormData();
form.append("file", fs.createReadStream("statement.pdf"));
const res = await fetch("https://api.bankstatementlab.com/v1/extractions", {
method: "POST",
headers: { Authorization: `Bearer $${process.env.BSL_KEY}` },
body: form,
});
const data = await res.json(); import requests
with open("statement.pdf", "rb") as f:
r = requests.post(
"https://api.bankstatementlab.com/v1/extractions",
headers={"Authorization": f"Bearer {BSL_KEY}"},
files={"file": f},
)
data = r.json() $ch = curl_init("https://api.bankstatementlab.com/v1/extractions");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Authorization: Bearer " . getenv("BSL_KEY")]);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
"file" => new CURLFile("statement.pdf"),
]);
$data = json_decode(curl_exec($ch), true); Responsformaten
De velden data, column_names en transaction_count zijn alleen aanwezig wanneer status gelijk is aan "completed". Anders ontbreken ze in de JSON (ze zijn niet null).
GET /v1/extractions/:id
200 OK — Extractie voltooid
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "ext_3f8a9b2c1d4e5f6a7b8c9d0e",
"status": "completed",
"file_name": "statement-march-2026.pdf",
"created_at": "2026-03-15T10:23:00.000Z",
"completed_at": "2026-03-15T10:23:18.000Z",
"page_count": 3,
"credits_charged": 3,
"api_key_id": "ak_abc123",
"column_names": ["Date", "Description", "Amount"],
"transaction_count": 42,
"data": {
"columns": ["Date", "Description", "Amount"],
"transactions": [
["2026-03-01", "VIREMENT SEPA", "1500.00"],
["2026-03-02", "CB CARREFOUR", "-45.20"]
]
}
} 200 OK — Extractie wordt uitgevoerd
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "ext_3f8a9b2c1d4e5f6a7b8c9d0e",
"status": "processing",
"file_name": "statement-march-2026.pdf",
"created_at": "2026-03-15T10:23:00.000Z",
"page_count": 3,
"credits_charged": 3,
"api_key_id": "ak_abc123"
} 200 OK — Extractie mislukt
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "ext_3f8a9b2c1d4e5f6a7b8c9d0e",
"status": "failed",
"file_name": "statement-march-2026.pdf",
"created_at": "2026-03-15T10:23:00.000Z",
"completed_at": "2026-03-15T10:23:32.000Z",
"page_count": 3,
"credits_charged": 3,
"api_key_id": "ak_abc123",
"error": {
"type": "extraction_failed",
"message": "Extraction failed due to an internal error. Contact support if the issue persists."
}
} Polling-patroon
Wanneer een extractie in async-modus draait, bevat de respons status: "processing" totdat de worker klaar is. Controleer altijd of status gelijk is aan "completed" VOORDAT u de velden data, transaction_count en column_names leest; ze ontbreken in de JSON totdat de extractie is voltooid.
Aanbevolen polling-frequentie aan clientzijde: 5 tot 10 seconden. De serverworker draait elke 10 seconden; sneller pollen versnelt het resultaat niet.
GET /v1/extractions
200 OK — Gemengde pagina (één element per status)
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": [
{
"id": "ext_001",
"status": "completed",
"file_name": "march.pdf",
"created_at": "2026-03-15T10:00:00.000Z",
"completed_at": "2026-03-15T10:00:18.000Z",
"page_count": 3,
"credits_charged": 3,
"api_key_id": "ak_abc123",
"column_names": ["Date", "Description", "Amount"],
"transaction_count": 42
},
{
"id": "ext_002",
"status": "processing",
"file_name": "april.pdf",
"created_at": "2026-04-15T10:00:00.000Z",
"page_count": 5,
"credits_charged": 5,
"api_key_id": "ak_abc123"
},
{
"id": "ext_003",
"status": "failed",
"file_name": "may.pdf",
"created_at": "2026-05-15T10:00:00.000Z",
"completed_at": "2026-05-15T10:00:42.000Z",
"page_count": 2,
"credits_charged": 2,
"api_key_id": "ak_abc123",
"error": {
"type": "extraction_failed",
"message": "Extraction failed due to an internal error. Contact support if the issue persists."
}
}
],
"has_more": false
} Polling-patroon
Wanneer een extractie in async-modus draait, bevat de respons status: "processing" totdat de worker klaar is. Controleer altijd of status gelijk is aan "completed" VOORDAT u de velden data, transaction_count en column_names leest; ze ontbreken in de JSON totdat de extractie is voltooid.
Aanbevolen polling-frequentie aan clientzijde: 5 tot 10 seconden. De serverworker draait elke 10 seconden; sneller pollen versnelt het resultaat niet.
Gebouwd voor
Boekhoudkundige automatisering
Importeer klantafschriften rechtstreeks in uw boekhoudpijplijn.
Due diligence kredietverlening
Controleer de inkomsten en cashflow aan de hand van de bankafschriften van de aanvrager.
Persoonlijke financiële apps
Laat gebruikers hun afschriften koppelen zonder handmatige gegevensinvoer.
Dezelfde credits, web + API
1 credit = 1 pagina. Credits worden gedeeld met uw Pro- of Business-abonnement; voor de API geldt geen afzonderlijk minimum.
Zie prijzen →Veelgestelde vragen
Begin vandaag nog met bouwen
Het gratis niveau omvat 5 credits. Geen creditcard vereist.
Haal uw API-sleutel op