Electricity Bill OCR

​Extract Electricity Bill information from an image or photo.

Response Definition

http statuserror_codeerror_messageerror_parametersdescription

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

NameTypeDescription

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