Bank Statement OCR
Extract bank statement information from image/PDF
Error Definition
http status | error_code | error_message |
---|---|---|
200 | - | - |
400 | 2001 | Image too small expect > 1000X1000 pixels |
500 | 1000 | Internal server error |
List of additional_result keys
key name | key definition |
---|---|
bank_name | bank name of each page |
Extract bank statement information
POST
https://apis.aigen.online/aiscript/bank-statement/v1
Request Body
Name | Type | Description |
---|---|---|
image* | String | Input base64 image encoded utf-8 |
{
"status": "200",
"message": "success",
"response_id": "123wereqs2",
"error_list": [
{
"code": "1001",
"message": "fail to rotate image, expect to got response.status_code = 200 but got : 502"
}
],
"result": [
[
[
{
"key": "วันที่ทำรายการ",
"text": "01/10/2020 12:44:37",
"confidence": 0.99975,
"bbox": [
[
[
79,
517
],
[
176,
516
],
[
176,
538
],
[
79,
538
]
],
[
[
94,
541
],
[
163,
541
],
[
163,
561
],
[
94,
561
]
]
]
},
{
"key": "รายการ",
"text": "ฝากด้วยเช็คเคลียริ่ง ไม่มีสมุดคู่ฝาก",
"confidence": 0.9995,
"bbox": [
[
[
221,
522
],
[
487,
526
],
[
487,
553
],
[
221,
550
]
]
]
},
{
"key": "ถอนเงิน",
"text": "",
"confidence": 0,
"bbox": []
},
{
"key": "ฝากเงิน",
"text": "17,762.00",
"confidence": 0.9998,
"bbox": [
[
[
918,
530
],
[
997,
530
],
[
997,
550
],
[
918,
550
]
]
]
},
{
"key": "ยอดคงเหลือ",
"text": "5,739,981.87",
"confidence": 0.9995,
"bbox": [
[
[
1155,
529
],
[
1259,
529
],
[
1260,
550
],
[
1156,
551
]
]
]
},
{
"key": "ชองทางบริการ",
"text": "CCS00043 สาขาหัวหมาก ทาวน เซ็นเตอร",
"confidence": 0.99665,
"bbox": [
[
[
1291,
540
],
[
1375,
539
],
[
1375,
561
],
[
1291,
561
]
],
[
[
1292,
518
],
[
1524,
517
],
[
1524,
537
],
[
1293,
538
]
]
]
}
]
]
],
"additional_result": [
[
[
{
"key": "วันที่ทำรายการ",
"text": "01/10/2020 12:44:37",
"confidence": 0.99975,
"bbox": [
[
[
79,
517
],
[
176,
516
],
[
176,
538
],
[
79,
538
]
],
[
[
94,
541
],
[
163,
541
],
[
163,
561
],
[
94,
561
]
]
]
},
{
"key": "รายการ",
"text": "ฝากด้วยเช็คเคลียริ่ง ไม่มีสมุดคู่ฝาก",
"confidence": 0.9995,
"bbox": [
[
[
221,
522
],
[
487,
526
],
[
487,
553
],
[
221,
550
]
]
]
},
{
"key": "ถอนเงิน",
"text": "",
"confidence": 0,
"bbox": []
},
{
"key": "ฝากเงิน",
"text": "17,762.00",
"confidence": 0.9998,
"bbox": [
[
[
918,
530
],
[
997,
530
],
[
997,
550
],
[
918,
550
]
]
]
},
{
"key": "ยอดคงเหลือ",
"text": "5,739,981.87",
"confidence": 0.9995,
"bbox": [
[
[
1155,
529
],
[
1259,
529
],
[
1260,
550
],
[
1156,
551
]
]
]
},
{
"key": "ชองทางบริการ",
"text": "CCS00043 สาขาหัวหมาก ทาวน เซ็นเตอร",
"confidence": 0.99665,
"bbox": [
[
[
1291,
540
],
[
1375,
539
],
[
1375,
561
],
[
1291,
561
]
],
[
[
1292,
518
],
[
1524,
517
],
[
1524,
537
],
[
1293,
538
]
]
]
}
]
]
]
}
{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}
Example code
import requests
import json
api = "https://apis.aigen.online/aiscript/bank-statement/v1"
headers = {"x-aigen-key": "<key>", "content-type": "application/json"}
data = json.dumps({"image": "<base64_string>"})
res = requests.post(api, data=data, headers=headers)
print(res.json())
const axios = require("axios");
const api = "https://apis.aigen.online/aiscript/bank-statement/v1";
const headers = {
"x-aigen-key": "<key>",
};
const data = { image: "<base64_string>" };
axios
.post(api, data, { headers: headers })
.then((res) => {
console.log(res.data);
})
.catch((err) => {
console.error(err.response.data);
});
Last updated