Electricity Bill OCR
API Documentation for 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 |
info
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 |
- 200: OK Successful response
- 400: Bad Request Cannot convert image
{
"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
}
]
}
{
"status": "001",
"response_id": "string",
"message": "error",
"error_list": "cannot convert image please check your image (image must be base64 of png,jpg,tif,tiff,pdf)",
"result": "Unknown Type: null"
}
Example code
- Python
- Nodejs
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())
const axios = require("axios");
const api = "https://apis.aigen.online/aiscript/utility-electricitybill/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);
});