支持对营业执照的证件编号、社会信用代码、单位名称、地址、法人、类型、成立日期、有效日期、经营范围等关键字段进行结构化识别
无参数
无参数
名称 | 类型 | 是否必须 | 描述 |
---|---|---|---|
secret_key | string | true | 用户授权key |
secret_code | string | true | 接口编号 |
secret_sign | string | true | 加密签名:md5(secret_key+secret_secret)转大写 |
image | string | true | 图像数据,base64编码后进行urlencode,要求base64编码和urlencode后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/jpeg/png/bmp格式 |
detectDirection | string | false | 可选值 true,false是否检测图像朝向,默认不检测,即:false。可选值包括true - 检测朝向;false - 不检测朝向。朝向是指输入图像是正常方向、逆时针旋转90/180/270度 |
accuracy | string | false | 可选值:normal,high参数选normal或为空使用快速服务;选择high使用高精度服务,但是时延会根据具体图片有相应的增加 |
curl http://cloud.kuaidi100.com/api -X POST -d \
"secret_key=***&secret_code=e1e66a288a7c43f299c68c82f5614b1a&secret_sign=md5(***)&image=&detectDirection=&accuracy="
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import java.util.Map;
public class CloudDemo {
public static void main (String[] args) {
CloudDemo cloudDemo = new CloudDemo();
Map params = new HashMap();
params.put("secret_key", "***");
params.put("secret_code", "e1e66a288a7c43f299c68c82f5614b1a");
params.put("secret_sign", "md5(***)");
params.put("image", "");
params.put("detectDirection", "");
params.put("accuracy", "");
cloudDemo.post(params);
}
public String post(Map params) {
StringBuilder response = new StringBuilder("");
BufferedReader reader = null;
try {
StringBuilder builder = new StringBuilder();
for (Map.Entry param : params.entrySet()) {
if (builder.length() > 0) {
builder.append('&');
}
builder.append(URLEncoder.encode(param.getKey(), "UTF-8"));
builder.append('=');
builder.append(URLEncoder.encode(String.valueOf(param.getValue()), "UTF-8"));
}
byte[] bytes = builder.toString().getBytes("UTF-8");
URL url = new URL("http://cloud.kuaidi100.com/api");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setConnectTimeout(5000);
conn.setReadTimeout(5000);
conn.setRequestMethod("POST");
conn.setRequestProperty("accept", "*/*");
conn.setRequestProperty("connection", "Keep-Alive");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setRequestProperty("Content-Length", String.valueOf(bytes.length));
conn.setDoOutput(true);
conn.getOutputStream().write(bytes);
reader = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
String line = "";
while ((line = reader.readLine()) != null) {
response.append(line);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (null != reader) {
reader.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
return response.toString();
}
}
class MD5Utils { private static MessageDigest mdigest = null;
private static char digits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
private static MessageDigest getMdInst() {
if (null == mdigest) {
try {
mdigest = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
}
return mdigest;
}
public static String encode(String s) {
if(null == s) {
return "";
}
try { byte[] bytes = s.getBytes();
getMdInst().update(bytes);
byte[] md = getMdInst().digest();
int j = md.length;
char str[] = new char[j * 2];
int k = 0;
for(int i = 0; i < j; i++) {
byte byte0 = md[i];
str[k++] = digits[byte0 >>> 4 & 0xf];
str[k++] = digits[byte0 & 0xf];
}
return new String(str);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
暂无示例
<?php
$params = "";
$params .= 'secret_key=***'.'&';
$params .= 'secret_code=e1e66a288a7c43f299c68c82f5614b1a'.'&';
$params .= 'secret_sign=md5(***)'.'&';
$params .= 'image='.'&';
$params .= 'detectDirection='.'&';
$params .= 'accuracy='.'&';
$params .= substr($params, 0, -1);
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL, 'http://cloud.kuaidi100.com/api');
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
echo $result;
?>
# coding = utf-8
import sys,os
import requests,json,hashlib
params = {}
params['secret_key'] = '***'
params['secret_code'] = 'e1e66a288a7c43f299c68c82f5614b1a'
params['secret_sign'] = 'md5(***)'
params['image'] = ''
params['detectDirection'] = ''
params['accuracy'] = ''
result = requests.post('http://cloud.kuaidi100.com/api', params)
print(result.text)
无参数
{
"code":200,
"message":"success",
"data":{
"errorCode":null,
"errorMessage":null,
"taskId":"6083085132953254090",
"resultNum":"11",
"result":{
"unitName":{
"location":{
"x":156,
"y":206,
"width":137,
"height":14
},
"resultStr":"海南诚德丰餐饮服务有限公司"
},
"type":{
"location":{
"x":156,
"y":230,
"width":121,
"height":14
},
"resultStr":"有限责任公司(台港澳合资"
},
"legalPerson":{
"location":{
"x":155,
"y":280,
"width":19,
"height":14
},
"resultStr":"李楚"
},
"address":{
"location":{
"x":156,
"y":255,
"width":167,
"height":14
},
"resultStr":"海口市海甸五路北侧A2商住楼601室"
},
"dateOfEstablishment ":{
"location":{
"x":154,
"y":329,
"width":76,
"height":14
},
"resultStr":"2014年03月03日"
},
"businessScope":{
"location":{
"x":49,
"y":372,
"width":340,
"height":215
},
"resultStr":"中、西在公2⑤南)p[Q品MG几aM"
}
}
}
}
{
"code":400
}
状态码 | 状态码信息 | 描述 |
---|---|---|
200 | 成功 |
使用营业执照识别技术,实现对企业信息的结构化识别和录入,可应用于电商、零售、O2O等行业的商户入驻审查场景,实现商户信息的自动化审查和录入,有效提高客户体验,并大幅度提升服务标准和运营效率
产品优势:
技术领先
支持对不同时期不同版式营业执照的结构化识别,能够满足对各式营业执照任意关键字段进行提取的需求
服务稳定
提供高可靠性、弹性可伸缩、高并发承载的文字识别服务,服务可用性高达99.99%