可識別身份證正、反面,正/反面需要分開請求
https://api.ihuyi.com/ocr/idcard/Submit.json
| 參數(shù)名稱 | 參數(shù)值描述 | 示例 | 類型 | 必填 |
| Content-Type | 內容類型,固定值 | application/x-www-form-urlencoded | string | 是 |
| 參數(shù)名稱 | 參數(shù)值描述 | 示例 | 類型 | 必填 |
| account | APIID(用戶中心【認證核驗】-【OCR識別】-【產品總覽】查看) | xxxxxxxx | string | 是 |
| password | 1、APIKEY(用戶中心【認證核驗】-【OCR識別】-【產品總覽】查看) 2、動態(tài)密碼(生成動態(tài)密碼方式請看該文檔末尾的說明) |
xxxxxxxxx | string | 是 |
| img_file | 圖片文件(multipart file,小于1MB,支持jpg、png、bmp) | file | 否 | |
| img_url | 圖片url(img_file、img_url二選一傳遞,小于1MB,支持jpg、png、bmp) | string | 否 | |
| time | Unix時間戳(10位整型數(shù)字,當使用動態(tài)密碼方式時為必填) | 1623643787 | string | 否 |
| 參數(shù)名稱 | 參數(shù)值描述 | 示例 | 類型 | 必返 |
| code | 返回值為2時,表示提交成功 | 2|1 | int | 是 |
| msg | 提交結果描述 | 提交成功|提交失敗 | string | 是 |
| idcardid | 當提交成功后,此字段為流水號,否則為0或空 | 16236437872836|0 | string | |
| result | 識別結果 | object | ||
| info[] | 數(shù)據(jù) | array | ||
| name | 姓名 | 林** | string | |
| idcard | 身份證號 | 350*************59 | string | |
| sex | 性別 | 男 | string | |
| nation | 民族 | 漢 | string | |
| birthday | 生日 | 19**年12月16日 | string | |
| address | 地址 | 福建省**市**鎮(zhèn)***路東**號 | string | |
| authority | 簽發(fā)機關 | 北京市公安局西城分局 | string | |
| timelimit | 有效期限 | 2004.10.27-2024.10.26 | string |
| code | msg |
| 0 | 未知錯誤 |
| 1 | 提交失敗 |
| 2 | 提交成功 |
| 400 | 非法ip訪問 |
| 401 | 帳號不能為空 |
| 402 | 密碼不能為空 |
| 403 | 應用不存在 |
| 405 | API ID 或 API KEY 不正確 |
| 4050 | 賬號被凍結 |
| 40501 | 動態(tài)密碼已過期 |
| 40502 | 動態(tài)密碼校驗失敗 |
| 40505 | 沒有簽定合同 |
| 4051 | 剩余條數(shù)不足 |
| 4052 | 訪問 ip 與備案 ip 不符 |
| 4086 | 通道無效 |
| 4010 | 通道錯誤 |
| 4201 | 查詢失敗 |
| 4202 | 圖片識別失敗 |
| 4301 | img_file、img_url不能同時為空 |
| 4302 | 上傳圖片大小必須控制在5KB-1MB之間 |
| 4303 | 上傳圖片格式不正確,只支持bmp,jpg,jpeg,png |
| 4304 | 上傳圖片失敗 |
https://api.ihuyi.com/ocr/idcard/Submit.json?account=xxxxxxxx&password=xxxxxxxxx&img_file=&img_url=&time=1623643787
示例(成功)
<?xml version="1.0" encoding="utf-8"?><SubmitResult><code>2</code><msg>提交成功</msg><idcardid>16236437872836</idcardid><result><info><list><name>林**</name><idcard>350*************59</idcard><sex>男</sex><nation>漢</nation><birthday>19**年12月16日</birthday><address>福建省**市**鎮(zhèn)***路東**號</address><authority>北京市公安局西城分局</authority><timelimit>2004.10.27-2024.10.26</timelimit></list><list><name>林**</name><idcard>350*************59</idcard><sex>男</sex><nation>漢</nation><birthday>19**年12月16日</birthday><address>福建省**市**鎮(zhèn)***路東**號</address><authority>北京市公安局西城分局</authority><timelimit>2004.10.27-2024.10.26</timelimit></list><list><name>林**</name><idcard>350*************59</idcard><sex>男</sex><nation>漢</nation><birthday>19**年12月16日</birthday><address>福建省**市**鎮(zhèn)***路東**號</address><authority>北京市公安局西城分局</authority><timelimit>2004.10.27-2024.10.26</timelimit></list></info></result></SubmitResult> {"code":2,"msg":"提交成功","idcardid":"16236437872836","result":{"info":[{"name":"林**","idcard":"350*************59","sex":"男","nation":"漢","birthday":"19**年12月16日","address":"福建省**市**鎮(zhèn)***路東**號","authority":"北京市公安局西城分局","timelimit":"2004.10.27-2024.10.26"},{"name":"林**","idcard":"350*************59","sex":"男","nation":"漢","birthday":"19**年12月16日","address":"福建省**市**鎮(zhèn)***路東**號","authority":"北京市公安局西城分局","timelimit":"2004.10.27-2024.10.26"},{"name":"林**","idcard":"350*************59","sex":"男","nation":"漢","birthday":"19**年12月16日","address":"福建省**市**鎮(zhèn)***路東**號","authority":"北京市公安局西城分局","timelimit":"2004.10.27-2024.10.26"}]}}
示例(失?。?/p>
<?xml version="1.0" encoding="utf-8"?><SubmitResult><code>1</code><msg>提交失敗</msg></SubmitResult> {"code":1,"msg":"提交失敗"}
$account = 'xxxxxxxx';
$password = 'xxxxxxxxx';
$app = 'idcard'; //固定值
$time = '1623643787';
$password=md5($account.$password.$app.$time);
$password=md5('xxxxxxxxxxxxxxxxxidcard1623643787');
//注意:所有字符編碼統(tǒng)一為UTF-8
國內專業(yè)互聯(lián)網團隊
21年行業(yè)經驗
7x24小時售后支持
豐富的行業(yè)經驗
Copyright ? 2004-2025 上海思銳信息技術有限公司 All rights reserved. 滬ICP備07035915號-15 電信增值業(yè)務許可證:B2-20160082
服務熱線:
4008 808 898
服務熱線(工作時間):
4008 808 898
業(yè)務咨詢(非工作時間):
售后咨詢(非工作時間):