營業執照辨識
從中國營業執照影像中擷取登記欄位,以及可用的信心分數和影像座標。
POST
取得 API 金鑰/v1/business-licenses/recognize請求
每次呼叫 · USD
- 中文
- US$0.04
- 其他語言
- US$0.05
請求標頭
| 名稱 | 必填 | 說明 |
|---|---|---|
Authorization | 是 | Bearer YOUR_API_KEY |
Content-Type | 是 | application/json或 application/octet-stream |
JSON 主體
| 欄位 | 類型 | 必填 | 說明 |
|---|---|---|---|
image_url | string | 否 | 可公開存取的影像 URL。請使用此欄位或二進位請求主體,勿同時使用。 |
language | string | 否 | 回應語言。 預設值 zh-CN.支援的語言(22)
|
在 JSON 中提供公開的影像 URL,或將影像作為二進位請求主體傳送。支援 PNG、JPG、JPEG、BMP、GIF、TIFF 或 WebP,大小上限為 10 MB。使用二進位請求時,請將 language 放在查詢字串中。
範例
cURL
curl -X POST 'https://api.chinavalidate.com/v1/business-licenses/recognize' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
--data '{"image_url":"https://example.com/business-license.jpg","language":"zh-TW"}'回應
回應中的 code 為 0 表示請求已完成。請讀取 data 取得結果。紀錄順序會保留。公司搜尋無結果且未回傳紀錄或總數時,data 為 null。
辨識結果顯示於 fields 下。可用的欄位信心分數及影像位置顯示於 field_details 下。
| 欄位 | 類型 | 必填 | 說明 |
|---|---|---|---|
data | object | 是 | 原始結果。後續需要公司中文法定名稱的請求,請使用 data 中的名稱。 |
translation | object | 否 | 以指定語言呈現的完整 data 副本,欄位、類型及清單順序相同。不需翻譯的值會原樣複製。非中文請求有結果時才會提供。 |
資料欄位
| 欄位 | 說明 |
|---|---|
algorithm_version | Algorithm version. Original value is preserved. |
angle | Angle. Original value is preserved. |
fields | 營業執照上辨識出的值。 |
fields.title | Title. Original value is preserved. |
fields.company_name | 公司的登記名稱。 |
fields.unified_social_credit_code | 公司的統一社會信用代碼,以字串回傳。 |
fields.company_type | 公司類型。 |
fields.business_address | 營業地址。 |
fields.legal_representative | 公司登記的法定代表人。 |
fields.business_scope | 公司登記的經營範圍。 |
fields.registered_capital | 登記的註冊資本。 |
fields.registration_date | 登記日期。 |
fields.validity_period | 有效期間。 |
fields.valid_from_date | 有效起始日期。 |
fields.valid_to_date | 有效截止日期。 |
fields.issue_date | 核發日期。 |
fields.company_form | 公司型態。 |
field_details | 各欄位可用的辨識信心分數及位置。 |
field_details.[].field_name | 欄位名稱。 |
field_details.[].value | 值。 |
field_details.[].field_name_confidence | 欄位名稱的辨識信心分數。 |
field_details.[].value_confidence | 欄位值的辨識信心分數。 |
field_details.[].value_positions | 辨識出的欄位值在影像中的座標。 |
field_details.[].value_positions.[].x | X。 |
field_details.[].value_positions.[].y | Y。 |
document_bounds | Document bounds. Original value is preserved. |
document_bounds.x0 | X0. Original value is preserved. |
document_bounds.y0 | Y0. Original value is preserved. |
document_bounds.x1 | X1. Original value is preserved. |
document_bounds.y1 | Y1. Original value is preserved. |
document_bounds.x2 | X2. Original value is preserved. |
document_bounds.y2 | Y2. Original value is preserved. |
document_bounds.x3 | X3. Original value is preserved. |
document_bounds.y3 | Y3. Original value is preserved. |
copy_type | Copy type. Original value is preserved. |
height | 影像高度,單位為像素。 |
width | 影像寬度,單位為像素。 |
original_height | Original height. Original value is preserved. |
original_width | Original width. Original value is preserved. |
figures | Figures. Original value is preserved. |
figures.[].type | Type. Original value is preserved. |
figures.[].x | X. Original value is preserved. |
figures.[].y | Y. Original value is preserved. |
figures.[].width | Width. Original value is preserved. |
figures.[].height | Height. Original value is preserved. |
figures.[].box | Box. Original value is preserved. |
figures.[].box.x | X. Original value is preserved. |
figures.[].box.y | Y. Original value is preserved. |
figures.[].box.width | Width. Original value is preserved. |
figures.[].box.height | Height. Original value is preserved. |
figures.[].box.angle | Angle. Original value is preserved. |
figures.[].points | Points. Original value is preserved. |
figures.[].points.[].x | X. Original value is preserved. |
figures.[].points.[].y | Y. Original value is preserved. |
回應範例 · zh-TW · 200 OK
{
"code": 0,
"msg": "ok",
"data": {
"algorithm_version": "1.0.0",
"angle": 0,
"fields": {
"title": "营业执照",
"company_name": "苏州示例精密制造有限公司",
"unified_social_credit_code": "91320505MA00000005",
"company_type": "有限责任公司",
"business_address": "江苏省苏州市高新区启明路88号",
"legal_representative": "陈晓禾",
"business_scope": "机械零部件加工及工业设备销售。",
"registered_capital": "伍佰万元整",
"registration_date": "2019-05-21",
"validity_period": "长期",
"valid_from_date": "2019-05-21",
"valid_to_date": "",
"issue_date": "2025-01-08",
"company_form": "企业法人"
},
"field_details": [
{
"field_name": "company_name",
"value": "苏州示例精密制造有限公司",
"field_name_confidence": 99,
"value_confidence": 98,
"value_positions": [
{
"x": 258,
"y": 302
},
{
"x": 538,
"y": 302
},
{
"x": 538,
"y": 331
},
{
"x": 258,
"y": 331
}
]
}
],
"document_bounds": {
"x0": 0,
"y0": 0,
"x1": 1279,
"y1": 0,
"x2": 1279,
"y2": 905,
"x3": 0,
"y3": 905
},
"copy_type": 0,
"height": 906,
"width": 1280,
"original_height": 906,
"original_width": 1280,
"figures": [
{
"type": "blicense_title",
"x": 458,
"y": 183,
"width": 369,
"height": 78,
"box": {
"x": 458,
"y": 183,
"width": 369,
"height": 78,
"angle": 0
},
"points": [
{
"x": 458,
"y": 183
},
{
"x": 827,
"y": 183
},
{
"x": 827,
"y": 261
},
{
"x": 458,
"y": 261
}
]
}
]
},
"translation": {
"algorithm_version": "1.0.0",
"angle": 0,
"fields": {
"title": "營業執照",
"company_name": "蘇州範例精密製造有限公司",
"unified_social_credit_code": "91320505MA00000005",
"company_type": "有限責任公司",
"business_address": "江蘇省蘇州市高新區啟明路88號",
"legal_representative": "陳曉河",
"business_scope": "機械零件加工及工業設備銷售。",
"registered_capital": "伍佰万元整",
"registration_date": "2019-05-21",
"validity_period": "長期",
"valid_from_date": "2019-05-21",
"valid_to_date": "",
"issue_date": "2025-01-08",
"company_form": "企業法人"
},
"field_details": [
{
"field_name": "company_name",
"value": "蘇州範例精密製造有限公司",
"field_name_confidence": 99,
"value_confidence": 98,
"value_positions": [
{
"x": 258,
"y": 302
},
{
"x": 538,
"y": 302
},
{
"x": 538,
"y": 331
},
{
"x": 258,
"y": 331
}
]
}
],
"document_bounds": {
"x0": 0,
"y0": 0,
"x1": 1279,
"y1": 0,
"x2": 1279,
"y2": 905,
"x3": 0,
"y3": 905
},
"copy_type": 0,
"height": 906,
"width": 1280,
"original_height": 906,
"original_width": 1280,
"figures": [
{
"type": "blicense_title",
"x": 458,
"y": 183,
"width": 369,
"height": 78,
"box": {
"x": 458,
"y": 183,
"width": 369,
"height": 78,
"angle": 0
},
"points": [
{
"x": 458,
"y": 183
},
{
"x": 827,
"y": 183
},
{
"x": 827,
"y": 261
},
{
"x": 458,
"y": 261
}
]
}
]
}
}錯誤與計費
已完成的請求會消耗 API 點數,包括一般無結果回應及發票不符的情況。輸入錯誤和服務失敗不收費。每個已完成的請求都會個別計費,包括重複請求。無結果或不含待翻譯文字的請求,按中文費率計費。
| HTTP | 操作 |
|---|---|
| 400 / 413 / 415 / 422 | 修正輸入內容、格式或大小後,再重新傳送請求。 |
| 401 / 403 | 請檢查 API 金鑰、其到期日及您的帳戶狀態。 |
| 402 | 儲值 API 點數後,再重試請求。 |
| 429 | 請等待 Retry-After 指定的時間後再重試。 |
| 500 / 502 / 503 / 504 | 服務恢復可用後請重試。 |
每個帳戶每分鐘最多 120 個請求。