身份证识别接口_身份证OCR识别API_身份证翻拍检测API

身份证识别接口_身份证OCR识别API_身份证翻拍检测API

支持身份证号码验证!支持身份证图片地址识别!底层托管阿里云Serverless平台,性能稳定。支持对二代居民身份证正反面的关键字段识别,包括姓名、性别、民族、出生日期、住址、身份证号、签发机关、有效期限,识别准确率可达98%以上

服务保障
请勿线下交易!90%的欺诈、纠纷、资金盗取均由线下交易导致。

产品能力

[]

产品亮点

支持身份证号码验证!支持身份证图片地址识别!底层托管阿里云Serverless平台,性能稳定。支持对二代居民身份证正反面的关键字段识别,包括姓名、性别、民族、出生日期、住址、身份证号、签发机关、有效期限,识别准确率可达98%以上

产品说明

更新记录

日期 更新内容
2022.11.16 次数包余量查询示例:点击前往
2020.12.16 优化响应时间,90%响应在1秒以内!
2020.11.24 更新接口识别速率,增加错误返回 用于判断是客户端错误还是服务端
2020.6.03 更新支持大于4M的远程图片(base64受限于请求body,建议统一使用图片远程地址)
2020.5.18 增加身份证号码规则验证,增加返回字段 valid
2020.5.10 优化升级图片不同角度识别效果,优化升级图片强弱曝光状态下的识别效果
2020.5.5 支持身份证正反面在一个图片中识别(需要修改id_card_side为正面front,反面back分别解析两次),如id_card_side=front则识别出正面数据,反之则为反面,还是需要请求两次!
2020.4.26 修改付费套餐包有效期(从1年有效期改为长期有效)
2020.4.25 新增返回参数msg,详见下方返回说明
2020.4.24 新增完整性校验
2020.4.23 新增检测头像内容
2020.4.22 更新 image参数支持图片远程地址
2020.3.20 优化识别效果
2019.11.20 新增身份证风险类型检测
2019.10.15 后端服务升级为ServerLess
2019.7.9 新增检测图像旋转角度
2018.11.10 支持对模糊图像的识别
2018.10.28 对外发布服务

 


 

请求参数:

名称 类型   描述
id_card_side STRING 必选 front 正面 back反面 若正反面在一张图片上,需分别用正反参数解析两次
image STRING 必选 身份证图片外网地址或base64编码,不含data:image/jpeg;base64,前缀,base64编码后进行urlencode,要求base64编码和urlencode后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
detect_direction STRING 可选 是否检测图像旋转角度,默认不检测,即:false。朝向是指输入图像是正常方向、逆时针旋转90/180/270度。可选值包括: - true:检测旋转角度并矫正识别; - false:不检测旋转角度,针对摆放情况不可控制的情况建议本参数置为true。
detect_risk STRING 可选 是否开启身份证风险类型(身份证复印件、临时身份证、身份证翻拍、修改过的身份证)功能,默认不开启,即:false。可选值:true-开启;false-不开启
detect_photo STRING 可选 是否检测头像内容,默认不检测。可选值:true-检测头像并返回头像的 base64 编码及位置信息

 

返回参数:

字段 一定返回 类型 说明
msg array 识别结果集
--以下为正面返回      
--valid   boolen 验证成功 :true  验证失败:false(不符合身份证号码规则)
--name   string 姓名
--birthday   string 出生日期,格式为Ymd
--sex   string 性别,男或女
--idcardno   string 身份证号码
--address   string 地址
--nation   string 民族
--以下为背面返回      
--gov   string 签发机关
--begindate   string 签发日期,格式为Ymd
--enddate   string 失效日期,格式为Ymd
direction int32 图像方向,当 detect_direction = true 时,返回该参数。 - -1:未定义, - 0:正向, - 1: 逆时针90度, - 2:逆时针180度, - 3:逆时针270度
image_status string normal-识别正常 reversed_side-身份证正反面颠倒 non_idcard-上传的图片中不包含身份证 blurred-身份证模糊 other_type_card-其他类型证照 over_exposure-身份证关键字段反光或过曝 over_dark-身份证欠曝(亮度过低) unknown-未知状态
risk_type string 输入参数 detect_risk = true 时,则返回该字段识别身份证类型: normal-正常身份证;copy-复印件;temporary-临时身份证;screen-翻拍;unknown-其他未知情况
edit_tool string 如果参数 detect_risk = true 时,则返回此字段。如果检测身份证被编辑过,该字段指定编辑软件名称,如:Adobe Photoshop CC 2014 (Macintosh),如果没有被编辑过则返回值无此参数
log_id uint64 唯一的log id,用于问题定位
photo string 当请求参数 detect_photo = true时返回,头像切图的 base64 编码(无编码头,需自行处理)
photo_location array() 当请求参数 detect_photo = true时返回,头像的位置信息(坐标0点为左上角)
idcard_number_type string 用于校验身份证号码、性别、出生是否一致,输出结果及其对应关系如下: **-1:**身份证正面所有字段全为空 **0:**身份证证号识别错误 **1:**身份证证号和性别、出生信息一致 **2:**身份证证号和性别、出生信息都不一致 **3:**身份证证号和出生信息不一致 **4:**身份证证号和性别信息不一致
words_result array() 定位和识别结果数组
words_result_num uint32 识别结果数,表示words_result的元素个数
+location array() 位置数组(坐标0点为左上角)
++left uint32 表示定位位置的长方形左上顶点的水平坐标
++top uint32 表示定位位置的长方形左上顶点的垂直坐标
++width uint32 表示定位位置的长方形的宽度
++height uint32 表示定位位置的长方形的高度
+words string 识别结果字符串

 

错误码(除400,403错误外,其他错误可联系技术解决QQ/微信:706448591)

错误码 错误信息 说明
400 Invalid URL URL错误
403 Forbidden 没有购买,或者购买次数用尽,或者URL错误
408 Request Timeout 超时
413 Payload Too Large request body太大
450   后端服务队列满,请求被拒绝,重试即可
460 Invalid Input - failed to parse json 上传的body不符合json格式要求,是非法json
461 Invalid Input - json format error - missing key: image 新格式:输入Json中缺少image键
旧格式:输入Json的inputs值中缺少image键
461 Invalid Input - json format error - image format error 新格式:输入Json中的image值不是字符串
旧格式:输入Json中的image值不是包含DataValue和DataType的Json串
461 Invalid Input - json format error - key inputs missing 旧格式:输入Json中缺少inputs键
461 Invalid Input - json format error - value of inputs must be a array 旧格式:输入Json中的inputs值不是一个array
461 Invalid Input - json format error - image DataValue format error 旧格式:输入Json的image键中的DataValue值不是字符串
461 Invalid Input - json format error - configure format error 旧格式:输入Json中的configure值不是包含DataValue和DataType的Json
461 Invalid Input - json format error - failed to parse config str: xxx 输入的configure不是合法的Json
461 Invalid Input - json format error - json parse runtime exception 输入的Json格式不符合要求
462 Invalid Input - image data error - download image from url error 从URL下载图像失败
462 Invalid Input - image data error - input image empty, please check your image binary data 输入的image是空字符串
462 Invalid Input - image data error - image decode failed, please check your image binary data 输入的image解码失败、base64编码的是不合法的图像格式
462 Invalid Input - image data error - base64decode error, please check your image binary data 输入的image不是合法的base64字符串
462 Invalid Input - image data error - please remove additional header: data:image/jpg:base64, 请删除base64字符串多余的头: data:image/jpg:base64
462 Invalid Input - image data error - base64decode error: incorrect padding in base64 string 输入的image不是合法的base64字符串,base64编码的数据长度需要是4的倍数,如果长度不够,需要再末尾加上=补足。
462 Invalid Input - image data error - base64decode error: base64decode error: incorrect base64 format data 输入的image不是合法的base64字符串,存在非法字符
462 Invalid Input - image data error - open gif image failed GIF图像打开失败
462 Invalid Input - image data error - read gif image failed GIF图像读取失败
462 Invalid Input - image data error - decode gif image failed GIF图像解码失败
462 Invalid Input - image data error - gif data error, no color map got GIF获取颜色映射表错误
462 Invalid Input - image data error - gif image empty GIF图像是为空
463 Invalid Input - wrong category 输入图像不是对应服务的图像,如行驶证服务请求的不是行驶证
464 Invalid Result - algorithm run failed OCR识别失败
464 Invalid Result - algorithm runtime exception OCR识别异常
464 Invalid Result - xxx OCR识别失败
469 Invalid Service - parse result error 内部异常
469 Invalid Service - error code missing 内部异常
502 Bad Gateway 识别程序超时并断开连接
503 Service Unavailable API网关等待超时断开连接

相关产品

名称 地址
行驶证识别 https://market.aliyun.com/products/57124001/cmapi031362.html
银行卡识别 https://market.aliyun.com/products/57124001/cmapi031365.html
驾驶证识别 https://market.aliyun.com/products/57124001/cmapi031363.html
营业执照识别 https://market.aliyun.com/products/57124001/cmapi031361.html
文字识别 https://market.aliyun.com/products/57124001/cmapi031356.html
票据识别 https://market.aliyun.com/products/57124001/cmapi031364.html
植物识别 https://market.aliyun.com/products/57124001/cmapi031359.html
动物识别 https://market.aliyun.com/products/57124001/cmapi031357.html
车型识别 https://market.aliyun.com/products/57124001/cmapi031354.html
车牌识别 https://market.aliyun.com/products/57124001/cmapi031355.html

 

其他产品

名称 地址
图像审核 https://market.aliyun.com/products/57124001/cmapi031366.html
头像审核 https://market.aliyun.com/products/57124001/cmapi031360.html
图片去背景 https://market.aliyun.com/products/57124001/cmapi033136.html

 

售后支持范围

售后服务范围为产品使用方面的技术支持,售后支持时间范围为合同期范围内
热搜类目 热搜产品 快速入口