Electricity Bill OCR

​Extract Electricity Bill information from an image or photo.

Response Definition

http status
error_code
error_message
error_parameters
description

200

200

success

-

OCR successful

400

001

cannot convert image please check your image (image must be base64 of png,jpg,tif,tiff,pdf)

-

422

Validation Error

​Confidence score is -1.0 when the value of each validation field is False.

Extract Electricity Bill information

POST https://apis.aigen.online/aiscript/utility-electricitybill/v1

Request Body

Name
Type
Description

image*

String

Base64 image encoded string

{
  "status": "200",
  "message": "success",
  "response_id": "string",
  "error_list": [
    {
      "code": "string",
      "message": "string"
    }
  ],
  "result": [
    {
      "key": "string",
      "bboxes": [
        [0,
          0
        ],
        [
          50,
          0
        ],
        [
          50,
          50
        ],
        [
          0,
          50
        ]
      ],
      "text": "4,345.00",
      "confidence": 0.98784
    }
  ]
}

​Example code

import requests
import json

api = "https://apis.aigen.online/aiscript/utility-electricitybill/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())

Last updated