Skip to content

识别文件中的名片

名片识别接口,通过上传 JPG / PNG / PDF 等文件类型进行一次性的名片识别。接口适用于20MB以下的文件,适用于英文、日语的名片。

Tip: 单租户限流:10QPS,同租户下的应用没有限流,共享本租户的 10QPS 限流

请求

项目
HTTP URLhttps://open.feishu.cn/open-apis/document_ai/v1/business_card/recognize
HTTP MethodPOST
接口频率限制10 次/秒
支持的应用类型custom,isv
权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用document_ai:business_card:recognize 识别名片

请求头

名称类型必填描述
Authorizationstringtenant_access_token 值格式:"Bearer access_token" 示例值:"Bearer t-7f1bcd13fc57d46bac21793a18e560" 了解更多:如何选择与获取 access token
Content-Typestring示例值:"multipart/form-data; boundary=---7MA4YWxkTrZu0gW"

请求体

名称类型必填描述
filefile识别名片的源文件(支持 JPG / PNG / PDF)
示例值:file binary

请求体示例

HTTP
---7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file";
Content-Type: application/octet-stream


---7MA4YWxkTrZu0gW

响应

响应体

名称类型描述
codeint错误码,非 0 表示失败
msgstring错误描述
data\--
  └ business_cardsrecognized_entities\[\]名片信息
    └ entitiesrecognized_entity\[\]识别的实体列表
      └ typestring识别的字段种类
可选值有
- contact_names: 联系人名 - company_names: 公司名 - departments: 部门 - job_titles: 职位 - emails: 邮箱 - websites: 网站 - addresses: 地址 - mobile_phones: 移动电话 - work_phones: 工作电话 - other_phones: 其他电话 - faxes: 传真
      └ valuestring识别出字段的文本信息

响应体示例

json
{
    "code": 0,
    "msg": "success",
    "data": {
        "business_cards": [
            {
                "entities": [
                    {
                        "type": "contact_names",
                        "value": "张三"
                    }
                ]
            }
        ]
    }
}

错误码

HTTP状态码错误码描述排查建议
4002110001Invalid file输入文件错误,参考文档检查输入参数
4002110002No business card detected.未检测出名片信息,参考文档检查输入文件是否有效
5002110010Network anomaly, please try again.后端服务异常或网络异常,可重新请求
4002110003You have reached the Intelligent document parsing limit. To continue using this function, please contact sales to purchase more.智能文档解析次数已达使用上限,如需继续使用,请联系销售购买

内容来源:飞书开放平台 · 自动爬取整理