Certificate of business registration
1. Extract information on Business Registration Certificate with image URL or pdf URL input
API:
| Method | URL |
|---|---|
| GET | https://demo.computervision.com.vn/api/v2/ocr/document/business_registration |
Params:
| Key | Value | Description |
|---|---|---|
img | https://example.com/image.png | URL của ảnh hoặc pdf |
format_type | url | Type of data to pass in, receive value: url, file, base64 |
get_thumb | true/false | Returns a aligned image |
Demo Python:
import requestsapi_key = "YOUR_API_KEY"api_secret = "YOUR_API_SECRET"image_url = 'https://example.com/image.png'response = requests.get("https://demo.computervision.com.vn/api/v2/ocr/document/business_registration?img=%s&format_type=url&get_thumb=false"% image_url,auth=(api_key, api_secret))print(response.json())
2. Extract information on Business Registration Certificate with image file or pdf file input
API:
| Method | URL | content-type |
|---|---|---|
| POST | https://demo.computervision.com.vn/api/v2/ocr/document/business_registration | multipart/form-data |
Params:
| Key | Value | Description |
|---|---|---|
format_type | file | Type of data to pass in, receive value: url, file, base64 |
get_thumb | true/false | Returns a aligned image |
Body:
| Key | Type | Value | Description |
|---|---|---|---|
img | file | example.jpg | Image file or pdf file |
Demo Python:
import requestsapi_key = "YOUR_API_KEY"api_secret = "YOUR_API_SECRET"image_path = '/path/to/your/image.jpg'response = requests.post("https://demo.computervision.com.vn/api/v2/ocr/document/business_registration?format_type=file&get_thumb=false",auth=(api_key, api_secret),files={'img': open(image_path, 'rb')})print(response.json())
3. Extract information on Business Registration Certificate with JSON input
API:
| Method | URL | content-type |
|---|---|---|
| POST | https://demo.computervision.com.vn/api/v2/ocr/document/business_registration | application/json |
Params:
| Key | Value | Description |
|---|---|---|
format_type | base64 | Type of data to pass in, receive value: url, file, base64 |
get_thumb | true/false | Returns a aligned image |
Body:
{"img": "iVBORw0KGgoAAAANSU..." // base64 string of the image or pdf to extract}
Demo Python:
import base64import ioimport requestsfrom PIL import Imagedef get_byte_img(img):img_byte_arr = io.BytesIO()img.save(img_byte_arr, format='PNG')encoded_img = base64.encodebytes(img_byte_arr.getvalue()).decode('ascii')return encoded_imgapi_key = "YOUR_API_KEY"api_secret = "YOUR_API_SECRET"img_name = "path_img"encode_cmt = get_byte_img(Image.open(img_name))response = requests.post("https://demo.computervision.com.vn/api/v2/ocr/document/business_registration?format_type=base64&get_thumb=false",auth=(api_key, api_secret),json={'img' : encode_cmt})print(response.json())
4. Response
The response will be a JSON with the following format:
{"data": [xxxx],"errorCode": string,"errorMessage": string}
The data field will contain the following information:
{"info": [xxxx],"type": "business_registration"}
The info field will contain the following information:
company_nameenglish_nameshort_namebusiness_coderegis_datedate_of_changeaddresscompany_phonefaxemailwebsiteauthorized_capitalpar_valuetotal_sharesrepresentative_namerepresentative_titlegenderdobethnicitynationalitydocument_typenumber_of_idcardissue_dateissued_athousehold_addressrepresentative_addresscompany_name_boxenglish_name_boxshort_name_boxbusiness_code_boxregis_date_boxdate_of_change_boxaddress_boxcompany_phone_boxfax_boxemail_boxwebsite_boxauthorized_capital_boxpar_value_boxtotal_shares_boxrepresentative_name_boxrepresentative_title_boxgender_boxdob_boxethnicity_boxnationality_boxdocument_type_boxnumber_of_idcard_boxissue_date_boxissued_at_boxhousehold_address_boxrepresentative_address_boxcompany_name_confidenceenglish_name_confidenceshort_name_confidencebusiness_code_confidenceregis_date_confidencedate_of_change_confidenceaddress_confidencecompany_phone_confidencefax_confidenceemail_confidencewebsite_confidenceauthorized_capital_confidencepar_value_confidencetotal_shares_confidencerepresentative_name_confidencerepresentative_title_confidencegender_confidencedob_confidenceethnicity_confidencenationality_confidencedocument_type_confidencenumber_of_idcard_confidenceissue_date_confidenceissued_at_confidencehousehold_address_confidencerepresentative_address_confidenceimage
Error code table:
| Code | Message |
|---|---|
| 0 | Success |
| 1 | The photo does not contain content |
| 2 | Url is unavailable |
| 3 | Incorrect image format |
| 4 | Out of requests |
| 5 | Incorrect api_key or api_secret |
| 6 | Incorrect format type |