Bank Statement OCR

Extract Bank Statement Information

Response Definition

HTTP Status
Code
Message
Description

200

-

-

OCR success.

400

bad_request

Image too small

Image base 64 might be too small to process please check resolution of your image

400

bad_request

Fail to process table extraction

Fail to process table on document

206

partial_content

Partial_content

Some page of request is invalid

Parameters

Body

Key
Type
Description

image

String

Base64 image encoded stringBase64 image encoded string

option

Dict

Input Boolean for Optional return

Option Key

Key
Type
Descript

return_statement_summary

Bool

Set True to return sum_withdraw, count_withdraw, sum_deposit, count_deposit

return_datetime_iso

Bool

Set True to return additional key for date time iso format for date time data

pdf_password

String

PDF password unlock

Extract Bank Statement Information

POST https://apis.aigen.online/aiscript/bank-statement/v2

Request Body

Name
Type
Description

image*

Input base64 images encoded utf-8

{
  "status": "success",
  "request_id": "150da2b0069699aedcb861a1afe4c585",
  "error": [],
  "data": [
    {
      "account_name": {},
      "bank_name": {
        "value": "ธนาคารกรุงศรีอยุธยา",
        "confidence": 0.9894000291824341,
        "bboxes": [
          [
            [
              65,
              274
            ],
            [
              127,
              274
            ],
            [
              127,
              296
            ],
            [
              65,
              296
            ]
          ]
        ],
        "bboxes_norm": [
          [
            [
              0.0398,
              0.1172
            ],
            [
              0.0774,
              0.1172
            ],
            [
              0.0774,
              0.1266
            ],
            [
              0.0398,
              0.1266
            ]
          ]
        ]
      },
      "date_range": {},
      "table_data": [
        [
          {
            "column": "",
            "value": "14/09/2022 20:49:07",
            "bboxes": [
              [
                [
                  59,
                  739
                ],
                [
                  267,
                  739
                ],
                [
                  267,
                  757
                ],
                [
                  59,
                  757
                ]
              ]
            ],
            "bboxes_norm": [
              [
                [
                  0.0357,
                  0.3159
                ],
                [
                  0.1615,
                  0.3159
                ],
                [
                  0.1615,
                  0.3236
                ],
                [
                  0.0357,
                  0.3236
                ]
              ]
            ],
            "confidence": 0.9982
          },
          {
            "column": "",
            "value": "MOBILE",
            "bboxes": [
              [
                [
                  1119,
                  736
                ],
                [
                  1195,
                  736
                ],
                [
                  1195,
                  764
                ],
                [
                  1119,
                  764
                ]
              ]
            ],
            "bboxes_norm": [
              [
                [
                  0.677,
                  0.3147
                ],
                [
                  0.7229,
                  0.3147
                ],
                [
                  0.7229,
                  0.3266
                ],
                [
                  0.677,
                  0.3266
                ]
              ]
            ],
            "confidence": 0.9462
          }
        ],
        [
          {
            "column": "",
            "value": "16/09/2022 01:32:20",
            "bboxes": [
              [
                [
                  59,
                  783
                ],
                [
                  267,
                  783
                ],
                [
                  267,
                  806
                ],
                [
                  59,
                  806
                ]
              ]
            ],
            "bboxes_norm": [
              [
                [
                  0.0357,
                  0.3348
                ],
                [
                  0.1615,
                  0.3348
                ],
                [
                  0.1615,
                  0.3446
                ],
                [
                  0.0357,
                  0.3446
                ]
              ]
            ],
            "confidence": 0.9763
          },
          {
            "column": "",
            "value": "OTHERS",
            "bboxes": [
              [
                [
                  1119,
                  781
                ],
                [
                  1198,
                  781
                ],
                [
                  1198,
                  811
                ],
                [
                  1119,
                  811
                ]
              ]
            ],
            "bboxes_norm": [
              [
                [
                  0.677,
                  0.3339
                ],
                [
                  0.7247,
                  0.3339
                ],
                [
                  0.7247,
                  0.3467
                ],
                [
                  0.677,
                  0.3467
                ]
              ]
            ],
            "confidence": 0.9462
          }
        ],
        [
          {
            "column": "",
            "value": "22/09/2022 13:52:24",
            "bboxes": [
              [
                [
                  59,
                  828
                ],
                [
                  267,
                  828
                ],
                [
                  267,
                  863
                ],
                [
                  59,
                  863
                ]
              ]
            ],
            "bboxes_norm": [
              [
                [
                  0.0357,
                  0.354
                ],
                [
                  0.1615,
                  0.354
                ],
                [
                  0.1615,
                  0.369
                ],
                [
                  0.0357,
                  0.369
                ]
              ]
            ],
            "confidence": 0.9847
          },
          {
            "column": "",
            "value": "MOBILE",
            "bboxes": [
              [
                [
                  1119,
                  828
                ],
                [
                  1195,
                  828
                ],
                [
                  1195,
                  863
                ],
                [
                  1119,
                  863
                ]
              ]
            ],
            "bboxes_norm": [
              [
                [
                  0.677,
                  0.354
                ],
                [
                  0.7229,
                  0.354
                ],
                [
                  0.7229,
                  0.369
                ],
                [
                  0.677,
                  0.369
                ]
              ]
            ],
            "confidence": 0.9462
          }
        ],
        [
          {
            "column": "",
            "value": "23/09/2022 01:23:42",
            "bboxes": [
              [
                [
                  59,
                  874
                ],
                [
                  267,
                  874
                ],
                [
                  267,
                  909
                ],
                [
                  59,
                  909
                ]
              ]
            ],
            "bboxes_norm": [
              [
                [
                  0.0357,
                  0.3737
                ],
                [
                  0.1615,
                  0.3737
                ],
                [
                  0.1615,
                  0.3886
                ],
                [
                  0.0357,
                  0.3886
                ]
              ]
            ],
            "confidence": 0.9953
          },
          {
            "column": "",
            "value": "OTHERS",
            "bboxes": [
              [
                [
                  1119,
                  874
                ],
                [
                  1198,
                  874
                ],
                [
                  1198,
                  909
                ],
                [
                  1119,
                  909
                ]
              ]
            ],
            "bboxes_norm": [
              [
                [
                  0.677,
                  0.3737
                ],
                [
                  0.7247,
                  0.3737
                ],
                [
                  0.7247,
                  0.3886
                ],
                [
                  0.677,
                  0.3886
                ]
              ]
            ],
            "confidence": 0.9462
          }
        ],
        [
          {
            "column": "",
            "value": "23/09/2022 18:21:29",
            "bboxes": [
              [
                [
                  59,
                  928
                ],
                [
                  267,
                  928
                ],
                [
                  267,
                  949
                ],
                [
                  59,
                  949
                ]
              ]
            ],
            "bboxes_norm": [
              [
                [
                  0.0357,
                  0.3968
                ],
                [
                  0.1615,
                  0.3968
                ],
                [
                  0.1615,
                  0.4057
                ],
                [
                  0.0357,
                  0.4057
                ]
              ]
            ],
            "confidence": 0.9982
          },
          {
            "column": "",
            "value": "MOBILE",
            "bboxes": [
              [
                [
                  1119,
                  926
                ],
                [
                  1195,
                  926
                ],
                [
                  1195,
                  954
                ],
                [
                  1119,
                  954
                ]
              ]
            ],
            "bboxes_norm": [
              [
                [
                  0.677,
                  0.3959
                ],
                [
                  0.7229,
                  0.3959
                ],
                [
                  0.7229,
                  0.4079
                ],
                [
                  0.677,
                  0.4079
                ]
              ]
            ],
            "confidence": 0.9462
          }
        ]
      ]
    }
  ]
}
import requests

api = "https://apis.aigen.online/aiscript/bank-statement/v2"
headers = {"x-aigen-key": "<key>"}
data = {"image": "<base64_string>"}

res = requests.post(api, json=data, headers=headers)
print(res.json())

Last updated