Certificate of business registration

1. Extract information on Business Registration Certificate with image URL or pdf URL input

API:

MethodURL
GEThttps://cloud.computervision.com.vn/api/v2/ocr/document/business_registration

Params:

KeyValueDescription
imghttps://example.com/image.pngURL của ảnh hoặc pdf
format_typeurlType of data to pass in, receive value: url, file, base64
get_thumbtrue/falseReturns a aligned image

Demo Python:

import requests
api_key = "YOUR_API_KEY"
api_secret = "YOUR_API_SECRET"
image_url = 'https://example.com/image.png'
response = requests.get(
"https://cloud.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:

MethodURLcontent-type
POSThttps://cloud.computervision.com.vn/api/v2/ocr/document/business_registrationmultipart/form-data

Params:

KeyValueDescription
format_typefileType of data to pass in, receive value: url, file, base64
get_thumbtrue/falseReturns a aligned image

Body:

KeyTypeValueDescription
imgfileexample.jpgImage file or pdf file

Demo Python:

import requests
api_key = "YOUR_API_KEY"
api_secret = "YOUR_API_SECRET"
image_path = '/path/to/your/image.jpg'
response = requests.post(
"https://cloud.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:

MethodURLcontent-type
POSThttps://cloud.computervision.com.vn/api/v2/ocr/document/business_registrationapplication/json

Params:

KeyValueDescription
format_typebase64Type of data to pass in, receive value: url, file, base64
get_thumbtrue/falseReturns a aligned image

Body:

{
"img": "iVBORw0KGgoAAAANSU..." // base64 string of the image or pdf to extract
}

Demo Python:

import base64
import io
import requests
from PIL import Image
def 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_img
api_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://cloud.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_name
  • english_name
  • short_name
  • business_code
  • regis_date
  • date_of_change
  • address
  • company_phone
  • fax
  • email
  • website
  • authorized_capital
  • par_value
  • total_shares
  • representative_name
  • representative_title
  • gender
  • dob
  • ethnicity
  • nationality
  • document_type
  • number_of_idcard
  • issue_date
  • issued_at
  • household_address
  • representative_address
  • company_name_box
  • english_name_box
  • short_name_box
  • business_code_box
  • regis_date_box
  • date_of_change_box
  • address_box
  • company_phone_box
  • fax_box
  • email_box
  • website_box
  • authorized_capital_box
  • par_value_box
  • total_shares_box
  • representative_name_box
  • representative_title_box
  • gender_box
  • dob_box
  • ethnicity_box
  • nationality_box
  • document_type_box
  • number_of_idcard_box
  • issue_date_box
  • issued_at_box
  • household_address_box
  • representative_address_box
  • company_name_confidence
  • english_name_confidence
  • short_name_confidence
  • business_code_confidence
  • regis_date_confidence
  • date_of_change_confidence
  • address_confidence
  • company_phone_confidence
  • fax_confidence
  • email_confidence
  • website_confidence
  • authorized_capital_confidence
  • par_value_confidence
  • total_shares_confidence
  • representative_name_confidence
  • representative_title_confidence
  • gender_confidence
  • dob_confidence
  • ethnicity_confidence
  • nationality_confidence
  • document_type_confidence
  • number_of_idcard_confidence
  • issue_date_confidence
  • issued_at_confidence
  • household_address_confidence
  • representative_address_confidence
  • image

Error code table:

CodeMessage
0Success
1The photo does not contain content
2Url is unavailable
3Incorrect image format
4Out of requests
5Incorrect api_key or api_secret
6Incorrect format type