Shipping Label OCR

Response Definition

HTTP Status
Code
Message
Description

200

-

-

OCR success.

206

partial_content

Partial_content

Some page request is invalid

400

bad_request

Can not detect label

Cannot detect Parcel Label in an image

413

413

The request base64 size is too large

Image is too large

422

422

Invalid base64 request or Image size is not supported

Invalid base64 request or Image size is not supported

Extract Shipping Label Information

POST https://apis.aigen.online/aiscript/shipping-label/v2

Request Body

Name
Type
Description

image*

String

Base64 image encoded stringBase64 image encoded string

{
   "status":"success",
   "request_id":"",
   "error":[
      
   ],
   "data":[
      {
         "reciever_name":{
            "value":"คุณ สุสิ สิสุ",
            "bboxes":[
               [
                  [
                     457,
                     1290
                  ],
                  [
                     1837,
                     1290
                  ],
                  [
                     1837,
                     1498
                  ],
                  [
                     457,
                     1498
                  ]
               ]
            ],
            "bboxes_norm":[
               [
                  [
                     0.1052,
                     0.3899
                  ],
                  [
                     0.4228,
                     0.3899
                  ],
                  [
                     0.4228,
                     0.453
                  ],
                  [
                     0.1052,
                     0.453
                  ]
               ]
            ],
            "confidence":0.9083
         },
         "reciever_address":{
            "value":"อาคารสุสิเลขที 111 ม.11 บ.ปอเหลือง",
            "bboxes":[
               [
                  [
                     785,
                     1550
                  ],
                  [
                     2711,
                     1550
                  ],
                  [
                     2711,
                     1714
                  ],
                  [
                     785,
                     1714
                  ]
               ]
            ],
            "bboxes_norm":[
               [
                  [
                     0.1808,
                     0.4687
                  ],
                  [
                     0.624,
                     0.4687
                  ],
                  [
                     0.624,
                     0.5181
                  ],
                  [
                     0.1808,
                     0.5181
                  ]
               ]
            ],
            "confidence":0.9783
         },
         "reciever_phone_number":{
            "value":"0111111111",
            "bboxes":[
               [
                  [
                     1929,
                     1305
                  ],
                  [
                     2823,
                     1305
                  ],
                  [
                     2823,
                     1485
                  ],
                  [
                     1929,
                     1485
                  ]
               ]
            ],
            "bboxes_norm":[
               [
                  [
                     0.444,
                     0.3946
                  ],
                  [
                     0.6496,
                     0.3946
                  ],
                  [
                     0.6496,
                     0.4488
                  ],
                  [
                     0.444,
                     0.4488
                  ]
               ]
            ],
            "confidence":0.9803
         }
      }
   ]
}
import requests

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

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

Last updated