Đăng ký kinh doanh
1. Trích xuất thông tin Đăng ký kinh doanh với đầu vào URL ảnh hoặc pdf
API:
| Method | URL |
|---|---|
| GET | https://demo.computervision.com.vn/api/v2/ocr/document/business_registration |
Params:
| Key | Value | Mô tả |
|---|---|---|
img | https://example.com/image.png | Đường dẫn đến ảnh hoặc file pdf của giấy đăng ký kinh doanh |
format_type | url | Loại data truyền vào, nhận giá trị: url, file, base64 |
get_thumb | true/false | Trả về ảnh giấy đăng ký kinh doanh đã được xoay và căn chỉnh |
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. Trích xuất thông tin Đăng ký kinh doanh với đầu vào file ảnh hoặc file pdf
API:
| Method | URL | content-type |
|---|---|---|
| POST | https://demo.computervision.com.vn/api/v2/ocr/document/business_registration | multipart/form-data |
Params:
| Key | Value | Mô tả |
|---|---|---|
format_type | file | Loại data truyền vào, nhận giá trị: url, file, base64 |
get_thumb | true/false | Trả về ảnh giấy đăng ký kinh doanh đã được xoay và căn chỉnh |
Body:
| Key | Type | Value | Mô tả |
|---|---|---|---|
img | file | example.jpg | File ảnh hoặc file pdf của giấy đăng ký kinh doanh cần trích xuất thông tin |
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. Trích xuất thông tin Đăng ký kinh doanh với đầu vào JSON
API:
| Method | URL | content-type |
|---|---|---|
| POST | https://demo.computervision.com.vn/api/v2/ocr/document/business_registration | application/json |
Params:
| Key | Value | Mô tả |
|---|---|---|
format_type | base64 | Loại data truyền vào, nhận giá trị: url, file, base64 |
get_thumb | true/false | Trả về ảnh giấy đăng ký ký kinh doanh đã được xoay và căn chỉnh |
Body:
{"img": "iVBORw0KGgoAAAANSU..." // string base64 của ảnh hoặc pdf cần trích xuất}
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. Thông tin trả về
Phản hồi sẽ là một JSON với định dạng sau:
{"data": list,"errorCode": string, // Mã lỗi"errorMessage": string // Thông báo lỗi}
Trường data là list, mỗi phần tử trong list là dictionary gồm các trường thông tin sau:
{"info": [xxxx],"type": [xxxx]}
Trong đó:
type: business_registration - Thể hiện đây là giấy đăng ký kinh doanhinfo: Thông tin trích xuất được từ giấy đăng ký kinh doanh, gồm các trường sau:company_name: Tên doanh nghiệp.company_name_box: Tọa độ tên doanh nghiệp là một list gồm [left, top, right, bottom].company_name_confidence: Độ tin cậy tên doanh nghiệp.english_name: Tên nước ngoài.english_name_box: Tọa độ tên nước ngoài là một list gồm [left, top, right, bottom].english_name_confidence: Độ tin cậy tên nước ngoài.short_name: Tên viết tắt.short_name_box: Tọa độ tên viết tắt là một list gồm [left, top, right, bottom].short_name_confidence: Độ tin cậy tên viết tắt.business_code: Mã số doanh nghiệp.business_code_box: Tọa độ mã số doanh nghiệp là một list gồm [left, top, right, bottom].business_code_confidence: Độ tin cậy mã số doanh nghiệp.regis_date: Ngày đăng ký.regis_date_box: Tọa độ ngày đăng ký là một list gồm [left, top, right, bottom].regis_date_confidence: Độ tin cậy ngày đăng ký.date_of_change: Ngày thay đổi.date_of_change_box: Tọa độ ngày thay đổi là một list gồm [left, top, right, bottom].date_of_change_confidence: Độ tin cậy ngày thay đổi.address: Địa chỉ.address_box: Tọa độ địa chỉ là một list gồm [left, top, right, bottom].address_confidence: Độ tin cậy địa chỉ.company_phone: Điện thoại.company_phone_box: Tọa độ điện thoại là một list gồm [left, top, right, bottom].company_phone_confidence: Độ tin cậy điện thoại.fax: Fax.fax_box: Tọa độ fax là một list gồm [left, top, right, bottom].fax_confidence: Độ tin cậy fax.email: Email.email_box: Tọa độ email là một list gồm [left, top, right, bottom].email_confidence: Độ tin cậy email.website: Website.website_box: Tọa độ website là một list gồm [left, top, right, bottom].website_confidence: Độ tin cậy website.authorized_capital: Vốn điều lệ.authorized_capital_box: Tọa độ vốn điều lệ là một list gồm [left, top, right, bottom].authorized_capital_confidence: Độ tin cậy vốn điều lệ.par_value: Mệnh giá cổ phần.par_value_box: Tọa độ mệnh giá cổ phần là một list gồm [left, top, right, bottom].par_value_confidence: Độ tin cậy mệnh giá cổ phần.total_shares: Tổng số cổ phần.total_shares_box: Tọa độ tổng số cổ phần là một list gồm [left, top, right, bottom].total_shares_confidence: Độ tin cậy tổng số cổ phần.business_field: Ngành nghề kinh doanh.business_field_box: Tọa độ ngành nghề kinh doanh là một list gồm [left, top, right, bottom].business_field_confidence: Độ tin cậy ngành nghề kinh doanh.business_entity: Chủ thể thành lập hộ kinh doanh.business_entity_box: Tọa độ chủ thể thành lập hộ kinh doanh là một list gồm [left, top, right, bottom].business_entity_confidence: Độ tin cậy chủ thể thành lập hộ kinh doanh.registration_location: Nơi cấp đăng ký kinh doanh.registration_location_box: Tọa độ nơi cấp đăng ký kinh doanh là một list gồm [left, top, right, bottom].registration_location_confidence: Độ tin cậy nơi cấp đăng ký kinh doanh.list_of_legal_representatives: Danh sách người đại diện công ty. Là một list, mỗi phần tử trong list là dictionary gồm các trường thông tin sau:representative_name: Họ tên người đại diện.representative_name_box: Tọa độ họ tên người đại diện là một list gồm [left, top, right, bottom].representative_name_confidence: Độ tin cậy họ tên người đại diện.representative_title: Chức danh người đại diện.representative_title_box: Tọa độ chức danh người đại diện là một list gồm [left, top, right, bottom].representative_title_confidence: Độ tin cậy chức danh người đại diện.gender: Giới tính.gender_box: Tọa độ giới tính là một list gồm [left, top, right, bottom].gender_confidence: Độ tin cậy giới tính.dob: Ngày sinh.dob_box: Tọa độ ngày sinh là một list gồm [left, top, right, bottom].dob_confidence: Độ tin cậy ngày sinh.ethnicity: Dân tộc.ethnicity_box: Tọa độ dân tộc là một list gồm [left, top, right, bottom].ethnicity_confidence: Độ tin cậy dân tộc.nationality: Quốc tịch.nationality_box: Tọa độ quốc tịch là một list gồm [left, top, right, bottom].nationality_confidence: Độ tin cậy quốc tịch.document_type: Loại giấy tờ.document_type_box: Tọa độ loại giấy tờ là một list gồm [left, top, right, bottom].document_type_confidence: Độ tin cậy loại giấy tờ.number_of_idcard: Số chứng minh thư.number_of_idcard_box: Tọa độ số chứng minh thư là một list gồm [left, top, right, bottom].number_of_idcard_confidence: Độ tin cậy số chứng minh thư.issue_date: Ngày cấp.issue_date_box: Tọa độ ngày cấp là một list gồm [left, top, right, bottom].issue_date_confidence: Độ tin cậy ngày cấp.issued_at: Nơi cấp.issued_at_box: Tọa độ nơi cấp là một list gồm [left, top, right, bottom].issued_at_confidence: Độ tin cậy nơi cấp.household_address: Địa chỉ hộ khẩu.household_address_box: Tọa độ địa chỉ hộ khẩu là một list gồm [left, top, right, bottom].household_address_confidence: Độ tin cậy địa chỉ hộ khẩu.representative_address: Nơi ở hiện tại.representative_address_box: Tọa độ nơi ở hiện tại là một list gồm [left, top, right, bottom].representative_address_confidence: Độ tin cậy nơi ở hiện tại.
individual_owner: Thông tin chủ sở hữu cá nhân. Là dictionary gồm các trường thông tin sau:individual_owner_name: Họ tên chủ sở hữu cá nhân.individual_owner_name_box: Tọa độ họ tên chủ sở hữu cá nhân là một list gồm [left, top, right, bottom].individual_owner_name_confidence: Độ tin cậy họ tên chủ sở hữu cá nhân.gender: Giới tính.gender_box: Tọa độ giới tính là một list gồm [left, top, right, bottom].gender_confidence: Độ tin cậy giới tính.dob: Ngày sinh.dob_box: Tọa độ ngày sinh là một list gồm [left, top, right, bottom].dob_confidence: Độ tin cậy ngày sinh.ethnicity: Dân tộc.ethnicity_box: Tọa độ dân tộc là một list gồm [left, top, right, bottom].ethnicity_confidence: Độ tin cậy dân tộc.nationality: Quốc tịch.nationality_box: Tọa độ quốc tịch là một list gồm [left, top, right, bottom].nationality_confidence: Độ tin cậy quốc tịch.document_type: Loại giấy tờ.document_type_box: Tọa độ loại giấy tờ là một list gồm [left, top, right, bottom].document_type_confidence: Độ tin cậy loại giấy tờ.number_of_idcard: Số chứng minh thư.number_of_idcard_box: Tọa độ số chứng minh thư là một list gồm [left, top, right, bottom].number_of_idcard_confidence: Độ tin cậy số chứng minh thư.issue_date: Ngày cấp.issue_date_box: Tọa độ ngày cấp là một list gồm [left, top, right, bottom].issue_date_confidence: Độ tin cậy ngày cấp.issued_at: Nơi cấp.issued_at_box: Tọa độ nơi cấp là một list gồm [left, top, right, bottom].issued_at_confidence: Độ tin cậy nơi cấp.household_address: Địa chỉ hộ khẩu.household_address_box: Tọa độ địa chỉ hộ khẩu là một list gồm [left, top, right, bottom].household_address_confidence: Độ tin cậy địa chỉ hộ khẩu.individual_owner_address: Nơi ở hiện tại.individual_owner_address_box: Tọa độ nơi ở hiện tại là một list gồm [left, top, right, bottom].individual_owner_address_confidence: Độ tin cậy nơi ở hiện tại.
business_owner: Thông tin chủ sở hữu doanh nghiệp. Là dictionary gồm các trường thông tin sau:business_owner_name: Tên chủ sở hữu doanh nghiệp.business_owner_name_box: Tọa độ tên chủ sở hữu doanh nghiệp là một list gồm [left, top, right, bottom].business_owner_name_confidence: Độ tin cậy tên chủ sở hữu doanh nghiệp.business_code: Mã số doanh nghiệp.business_code_box: Tọa độ mã số doanh nghiệp là một list gồm [left, top, right, bottom].business_code_confidence: Độ tin cậy mã số doanh nghiệp.issue_date: Ngày cấp.issue_date_box: Tọa độ ngày cấp là một list gồm [left, top, right, bottom].issue_date_confidence: Độ tin cậy ngày cấp.issued_at: Nơi cấp.issued_at_box: Tọa độ nơi cấp là một list gồm [left, top, right, bottom].issued_at_confidence: Độ tin cậy nơi cấp.address: Địa chỉ trụ sở chính.address_box: Tọa độ địa chỉ trụ sở chính là một list gồm [left, top, right, bottom].address_confidence: Độ tin cậy địa chỉ trụ sở chính.
membersContrSection: Danh sách thành viên góp vốnsttMembersContr: STT thành viên.sttMembersContr_box: Tọa độ STT thành viên là một list gồm [left, top, right, bottom].sttMembersContr_confidence: Độ tin cậy STT thành viên.sttMembersContr_id: Id của STT thành viên. Id theo list ảnh image_membersContrSection.membersContrFullName: Tên thành viên.membersContrFullName_box: Tọa độ tên thành viên là một list gồm [left, top, right, bottom].membersContrFullName_confidence: Độ tin cậy tên thành viên.membersContrFullName_id: Id của tên thành viên. Id theo list ảnh image_membersContrSection.membersContrAddress: Địa chỉ.membersContrAddress_box: Tọa độ địa chỉ là một list gồm [left, top, right, bottom].membersContrAddress_confidence: Độ tin cậy địa chỉ.membersContrAddress_id: Id của địa chỉ. Id theo list ảnh image_membersContrSection.addressCityCode: Mã Tỉnh/Thành phố.addressCityDictrict: Mã Quận/huyện.addressCityWard: Mã Phường/Xã.parValueCapital: Giá trị phần vốn góp.parValueCapital_box: Tọa độ giá trị phần vốn góp là một list gồm [left, top, right, bottom].parValueCapital_confidence: Độ tin cậy giá trị phần vốn góp.parValueCapital_id: Id của giá trị phần vốn góp. Id theo list ảnh image_membersContrSection.contributorCapitalRatio: Tỷ lệ.contributorCapitalRatio_box: Tọa độ tỷ lệ là một list gồm [left, top, right, bottom].contributorCapitalRatio_confidence: Độ tin cậy tỷ lệ.contributorCapitalRatio_id: Id của tỷ lệ. Id theo list ảnh image_membersContrSection.contributorIdentifyNumber: Số giấy tờ chứng thực.contributorIdentifyNumber_box: Tọa độ số giấy tờ chứng thực là một list gồm [left, top, right, bottom].contributorIdentifyNumber_confidence: Độ tin cậy số giấy tờ chứng thực.contributorIdentifyNumber_id: Id của số giấy tờ chứng thực. Id theo list ảnh image_membersContrSection.note: Ghi chú.note_box: Tọa độ ghi chú là một list gồm [left, top, right, bottom].note_confidence: Độ tin cậy ghi chú.note_id: Id của ghi chú. Id theo list ảnh image_membersContrSection.
image_membersContrSection: Ảnh trả về danh sách thành viên góp vốn. Là list ảnh định dạng string base64.image: Ảnh trả về của giấy đăng ký kinh doanh. Là list ảnh định dạng string base64.
Bảng mã lỗi:
| Mã lỗi | Message | Mô tả |
|---|---|---|
| 0 | Success | Thành công |
| 1 | Incorrect image format | Ảnh bị lỗi |
| 2 | Url is unavailable | Link ảnh bị lỗi |
| 3 | The photo does not contain content | Ảnh không chứa nội dung |
| 4 | Incorrect api_key or api_secret | api_key hoặc api_secret sai |
| 5 | Out of requests | Hết số lượng requests hữu dụng |
| 6 | Error when processing the request | Lỗi khi xử lý request |