APISpace 驾驶证OCR API
作者:互联网
APISpace 的 驾驶证OCR API,利用OCR识别技术,快速扫描并读取驾驶证件上包括证号、姓名、性别、国籍、住址、出生日期、初次领证日期、准驾车型、有效期限的信息。
APISpace 上面还多各种各样的API,包括常见的短信、物流、天气啥的,有需要的可以自己上去看看~
接口使用起来也是超级方便,仅需要以下短短几步,就能够实现了:
- 到 APISpace 注册账户
- 申请 驾驶证OCR API
- 申请之后就可以使用该接口了
PHP请求代码示例
<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => "https://eolink.o.apispace.com/ocr-driving/driving-license", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "image=&imageType=", CURLOPT_HTTPHEADER => array( "X-APISpace-Token:", "Authorization-Type:apikey", "Content-Type:" ), )); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
返回示例
{ chargeStatus: 1, message: "成功", data: { msg: "成功", code: "0", address: "江西省*******************附1号", tradeNo: "18062915552391159", sex: "男", birth: "19900416", firstGetCard: "20150506", number: "3603***********2536", carType: "C1", nationality: "中国", expiryTime: "20150506 - 20210506", name: "段**" }, code: "200000" }
标签:驾驶证,API,APISpace,OCR,curl,CURLOPT 来源: https://www.cnblogs.com/haiwan666/p/16668958.html