百度智能云卡证文字识别API文档 - 社保卡识别
文档简介:
接口描述:
支持识别全国各地社保卡,支持识别社会保障卡号、姓名、性别、出生日期、银行卡号、有效期限等8个字段。
在线调试:
您可以在 示例代码中心 中调试该接口,可进行签名验证、查看在线调用的请求内容和返回结果、示例代码的自动生成。
【百度智能云】通用场景文字识别
【百度智能云】卡证文字识别
【百度智能云】财务票据文字识别
【百度智能云】医疗票据文字识别
【百度智能云】交通场景文字识别
【百度智能云】教育场景文字识别
【百度智能云】其他场景文字识别
【百度智能云】iOCR自定义模板文字识别
【百度智能云】通用文字识别(标准版)
【百度智能云】通用文字识别(高精度版)
【百度智能云】网络图片文字识别
【百度智能云】手写文字识别
【百度智能云】门脸文字识别
接口描述
支持识别全国各地社保卡,支持识别社会保障卡号、姓名、性别、出生日期、银行卡号、有效期限等8个字段。
在线调试
您可以在 示例代码中心 中调试该接口,可进行签名验证、查看在线调用的请求内容和返回结果、示例代码的自动生成。
请求说明
请求示例
HTTP 方法: POST
请求URL: https://aip.baidubce.com/rest/2.0/ocr/v1/social_security_card
URL参数:
参数 | 值 |
---|---|
access_token | 通过API Key和Secret Key获取的access_token,参考“Access Token获取” |
Header如下:
参数 | 值 |
---|---|
Content-Type | application/x-www-form-urlencoded |
Body中放置请求参数,参数详情如下:
请求参数
参数 | 类型 | 是否必须 | 说明 |
---|---|---|---|
image | string | 和url二选一 |
图像数据,base64编码后进行urlencode,需去掉编码头(data:image/jpeg;base64, ) 要求base64编码和urlencode后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/jpeg/png/bmp格式 |
url | string | 和image二选一 |
图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/jpeg/png/bmp格式,当image字段存在时url字段失效 请注意关闭URL防盗链 |
请求代码示例
提示一:使用示例代码前,请记得替换其中的示例Token、图片地址或Base64信息。
提示二:部分语言依赖的类或库,请在代码注释中查看下载地址。
curl -i -k 'https://aip.baidubce.com/rest/2.0/ocr/v1/social_security_card?access_token=
【调用鉴权接口获取的token】' --data 'image=【图片Base64编码,需UrlEncode】
' -H 'Content-Type:application/x-www-form-urlencoded'
返回说明
返回参数
参数 | 类型 | 是否必须 | 说明 |
---|---|---|---|
log_id | uint64 | 是 | 请求标识码,随机数,唯一。 |
direction | int32 | 否 |
图像方向,当 detect_direction = true 时,返回该参数。 - - 1:未定义; - 0:正向; - 1:逆时针90度; - 2:逆时针180度; - 3:逆时针270度 |
words_result | object | 是 | 返回结果 |
+ card_number | string | 是 | 卡号 |
+ name | string | 是 | 姓名 |
+ sex | string | 是 | 性别 |
+ social_security_number | string | 是 | 社会保障卡号 |
+ birth_date | string | 是 | 出生日期 |
+ issue_date | string | 是 | 签发日期 |
+ bank_card_number | string | 是 | 银行卡号 |
+ expiry_date | string | 是 | 有效期限 |
返回示例
{ "direction": "0", "words_result": { "sex": { "word": "男" }, "birth_date":
{ "word": "1993年6月16日" }, "issue_date": { "word": "" }, "name": { "word":
"徐乐" }, "card_number": { "word": "122932663447" }, "bank_card_number":
{ "word": "" }, "expiry_date": { "word": "" }, "social_security_number":
{ "word": "130201199306168223" } }, "log_id": 1438866840412542540 }