身份证识别OCR :传入身份证照片,识别包括姓名、身份证号码、性别、民族、出生年月日、地址、签发机关及有效期。接入代码示例(Java):
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{"image":null,"url":null,"pdf":null,"pdf_page":null,"side":null}");
Request request = new Request.Builder()
.url("https://eolink.o.apispace.com/ocr-idcard/id-ocr-cl")
.method("POST",body)
.addHeader("X-APISpace-Token","")
.addHeader("Authorization-Type","apikey")
.addHeader("Content-Type","")
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
二维码识别OCR :对图片中的二维码、条形码进行检测和识别,返回存储的文字内容。接入代码示例(JavaScript/XHR):
var data = "{"image":null,"url":null,"pdf":null,"pdf_page":null}"
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://eolink.o.apispace.com/ocrbarcode/ocr/v1/barcode");
xhr.setRequestHeader("X-APISpace-Token","");
xhr.setRequestHeader("Authorization-Type","apikey");
xhr.setRequestHeader("Content-Type","application/json");
xhr.send(data);
通用文字识别OCR :可识别中、英、日、韩、法、德多种语言。接入代码示例(PHP/pecl_http):
<?php
$client = new http\Client;
$request = new http\Client\Request;
$body = new http\Message\Body;
$body->append("{"image":null,"url":null,"pdf":null,"pdf_page":null,"language":null}");
$request->setRequestUrl("eolink.o.apispace.com/ocrbase/ocr/v1/base");
$request->setRequestMethod("POST");
$request->setBody($body);
$request->setHeaders(array(
"X-APISpace-Token" => "",
"Authorization-Type" => "apikey",
"Content-Type" => "application/json"
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
银行卡识别OCR :自动定位银行卡图片区域,支持识别银行卡正面信息。接入代码示例(Python/Requests):
import requests
url = "https://eolink.o.apispace.com/bankcard/bankcard"
payload = {"image":null,"url":null,"pdf":null,"pdf_page":null}
headers = {
"X-APISpace-Token":"",
"Authorization-Type":"apikey",
"Content-Type":""
}
response=requests.request("POST", url, data=json.dumps(payload), headers=headers)
print(response.text)
驾驶证识别OCR :支持对驾驶证自动识别,并提取姓名、性别、国籍、住址、出生日期、初次领证日期、准驾车型、有效期限等驾驶证实体信息。接入代码示例(微信小程序):
var data = "{"image":null,"url":null,"side":null}"
wx.request({
"url":"https://eolink.o.apispace.com/ocr-driving/driving-license",
"method": "POST",
"header": {
"X-APISpace-Token":"",
"Authorization-Type":"apikey",
"Content-Type":""
},
"data": data,
"success": (response)=> {
console.log(response.data)
}
})