在线客服
登  录免费注册

高精准OCR图片文字识别技术

OCR识别API调用说明

接口说明(file格式):

接口地址:  http://netocr.com/api/recog.do或https://netocr.com/api/recog.do
接口调用方法:  post 
接口接收参数: 
MultipartFile file:  上传的文件(上传文件的字段名必须是“file”) 
String key:  用户ocrKey 
String secret:  用户ocrSecret 
Integer typeId:  证件类型(二代证2;行驶证6;驾照5;银行卡17;车牌19;名片 20其他详见附录) 
String format:  返回格式(xml或者json),如果format为空,则默认返回xml 

接口说明(base64格式):

接口地址:  http://netocr.com/api/recogliu.do或https://netocr.com/api/recogliu.do
接口调用方法:  post 
接口接收参数: 
String img:  图片的base64 
String key:  用户ocrKey 
String secret:  用户ocrSecret 
Integer typeId:  证件类型(二代证2;行驶证6;驾照5;银行卡17;车牌19;名片 20其他详见附录) 
String format:  返回格式(xml或者json),如果format为空,则默认返回xml 

人脸(人证)对比接口说明(file格式):

接口地址:  http://netocr.com/api/facerecog.do或https://netocr.com/api/facerecog.do
接口调用方法:  post 
接口接收参数: 
MultipartFile file:  上传的文件(上传文件的字段名必须是“file1”) 
MultipartFile file:  上传的文件(上传文件的字段名必须是“file2”) 
String key:  用户ocrKey 
String secret:  用户ocrSecret 
Integer typeId:  证件类型(人脸识别 21;人证合一 9999) 
String format:  返回格式(xml或者json),如果format为空,则默认返回xml 

人脸(人证)对比接口说明(base64格式):

接口地址:  http://netocr.com/api/faceliu.do或https://netocr.com/api/faceliu.do
接口调用方法:  post 
接口接收参数: 
String img1:  图片的base64 
String img2:  图片的base64 
String key:  用户ocrKey 
String secret:  用户ocrSecret 
Integer typeId:  证件类型(人脸识别 21;人证合一 9999) 
String format:  返回格式(xml或者json),如果format为空,则默认返回xml 

营业执照对比接口说明(file格式):

接口地址:  http://netocr.com/api/recoglen.do或https://netocr.com/api/recoglen.do
接口调用方法:  post 
接口接收参数: 
MultipartFile file:  上传的文件(上传文件的字段名必须是“file”) 
String key:  用户ocrKey 
String secret:  用户ocrSecret 
Integer typeId:  证件类型(营业执照 2008 其他详见附录) 
String outvalue:  输出选项(0为全部返回;其他详见附录) 
String format:  返回格式(xml或者json),如果format为空,则默认返回xml 

营业执照接口说明(base64格式):

接口地址:  http://netocr.com/api/recoglenliu.do或https://netocr.com/api/recoglenliu.do
接口调用方法:  post 
接口接收参数: 
String img:  图片的base64 
String key:  用户ocrKey 
String secret:  用户ocrSecret 
Integer typeId:  证件类型(营业执照 2008 其他详见附录) 
String outvalue:  输出选项(0为全部返回;其他详见附录) 
String format:  返回格式(xml或者json),如果format为空,则默认返回xml 

剩余条数查询接口(所有产品类型):

接口地址:  http://netocr.com/api/accountLift.do或https://netocr.com/api/accountLift.do
接口调用方法:  post 
接口接收参数: 
String key:  用户ocrKey 
String secret:  用户ocrSecret 
String format:  返回格式(xml或者json),如果format为空,则默认返回xml 

调用方式(java客户端基于httpclient4.3)

1.依赖库: \java客户端\httpClient4.3库\,如图:



2.示例程序代码详见: \java客户端\httpClientDemo\中的Client类,如图:



其中在main方法定义参数,并传入
doPost(url, file, key, secret, typeId, format) 方法中。如图:



执行main方法,返回识别结果:



人脸对比在main方法定义参数,并传入
doPost(url, file1,file2, key, secret, typeId, format) 方法中。如图:



执行main方法,返回识别结果:


识别结果字符串

1. XML格式说明证件编码及字段编码详见附录一和二。

<status/>标签显示了识别状态,大于“0”代表识别成功,小于等于“0”代表识别失败,失败的原因在<value/>中描述。

身份证识别结果示例:

下面是二代身份证识别结果示例:

<?xml version='1.0' encoding='UTF-8'?>
<data>
  <message>
    <status>2</status>
    <value>识别完成</value>
  </message>
  <cardsinfo>
    <card type=”2”>
      <item desc=”保留”></item>
      <item desc=”姓名”>王青</item>
      <item desc=”性别”>女</item>
      <item desc=”民族”>汉</item>
      <item desc=”出生”>1976-08-09</item>
      <item desc=”住址”>北京市昌平区回龙观</item>
      <item desc=”公民身份号码”>XXXXXXXXXXXXXXXXXXX</item>
      <item desc=”头像”>头像BASE64编码</item>
    </card>
  </cardsinfo>
</data>

下面是银行卡识别结果示例:

<?xml version='1.0' encoding='UTF-8'?>
<data>
  <message>
    <status>0</status>
    <value>识别完成</value>
  </message>
  <cardsinfo>
    <card type="17">
      <item desc="卡号"><![CDATA[406********56]]></item>
      <item desc="银行卡类型"><![CDATA[贷记卡]]></item>
      <item desc="银行卡名称"><![CDATA[广发VISA信用卡]]></item>
      <item desc="银行名称"><![CDATA[广发银行股份有限公司]]></item>
      <item desc="银行编号"><![CDATA[03060000]]></item>
      <item desc="有效日期"><![CDATA[11/07]]></item>
    </card>
  </cardsinfo>
</data>

下面是车牌识别结果示例:

<?xml version='1.0' encoding='UTF-8'?>
  <data>
    <message>
      <status>19</status>
      <value>识别完成<value>
    </message>
  <cardsinfo>
    <card type="19">
      <item desc="车牌号"><![CDATA[皖E4**89]]></item>
      <item desc="车牌颜色"><![CDATA[蓝]]></item>
      <item desc="车牌颜色"><![CDATA[1]]></item>
      <item desc="车牌类型"><![CDATA[1]]></item>
      <item desc="整牌可信度"><![CDATA[80]]></item>
      <item desc="亮度评价"><![CDATA[0]]></item>
      <item desc="车牌运动方向"><![CDATA[0]]></item>
      <item desc="车牌位置(left_top_right_bottom)"><![CDATA[265_370_394_404]]></item>
      <item desc="时间"><![CDATA[40]]></item>
    </card>
  </cardsinfo>
</data>

下面是名片识别结果示例:

<?xml version='1.0' encoding='UTF-8'?>
  <data>
    <message>
      <status>0</status>
      <value>识别完成<value>
    </message>
  <cardsinfo>
    <card type="20">
      <item nID="0" desc="姓名"><![CDATA[王**]]></item>
      <item nID="1" desc="职务/部门"><![CDATA[项目管理中心]]></item>
      <item nID="1" desc="职务/部门"><![CDATA[副总经理]]></item>
      <item nID="1" desc="职务/部门"><![CDATA[兼技术总监]]></item>
      <item nID="2" desc="手机"><![CDATA[12312312312]]></item>
      <item nID="3" desc="公司"><![CDATA[北京文通科技有限公司]]></item>
      <item nID="4" desc="地址"><![CDATA[北京市海淀区银谷大厦]]></item>
      <item nID="5" desc="电话"><![CDATA[021-51077666-201]]></item>
      <item nID="5" desc="电话"><![CDATA[800-78-010]]></item>
      <item nID="6" desc="传真"><![CDATA[021-51077677]]></item>
      <item nID="7" desc="电子邮箱"><![CDATA[wang.baoqin@cesgroup.com.cn]]></item>
      <item nID="8" desc="网址"><![CDATA[http://www.cesgroup.com.cn]]></item>
      <item nID="9" desc="邮编"><![CDATA[200338]]></item>
      <item nID="9" desc="邮编"><![CDATA[490011]]></item>
    </card>
  </cardsinfo>
</data>

下面是人脸比对结果示例:

<?xml version='1.0' encoding='UTF-8'?>
  <data>
    <message>
      <status>0</status>
      <value>比对完成<value>
    </message>
  <cardsinfo>
    <card type="21">
      <item desc="判定值"><![CDATA[0.3488521]]></item>
      <item desc="判定结果"><![CDATA[否]]></item>
    </card>
  </cardsinfo>
</data>

下面是人证合一比对结果示例:

<?xml version='1.0' encoding='UTF-8'?>
  <data>
    <message>
      <status>0</status>
      <value>比对完成<value>
    </message>
  <cardsinfo>
    <card type="9999">
      <item desc="判定值"><![CDATA[0.8718461]]></item>
      <item desc="判定结果"><![CDATA[是]]></item>
      <item desc="保留"><![CDATA[]]></item>
      <item desc="姓名"><![CDATA[刘XX]]></item>
      <item desc="性别"><![CDATA[男]]></item>
      <item desc="民族"><![CDATA[汉]]></item>
      <item desc="出生"><![CDATA[19xx-xx-xx]]></item>
      <item desc="住址"><![CDATA[山东省东平县XXXXX金山村213号]]></item>
      <item desc="公民身份号码"><![CDATA[370923XXXXXXXX3415]]></item>
    </card>
  </cardsinfo>
</data>

下面是营业执照结果示例:

选择输出字段1-18按顺序对应输出

<?xml version="1.0" encoding="UTF-8"?>
<data>
   <message>
      <status>0</status>
      <value>识别完成</value>
   </message>
   <cardsinfo>
      <card type="2008">
         <item desc="统一社会信用代码"><![CDATA[91xXXXXXXXX61786K]]></item>
         <item desc="组织机构代码"><![CDATA[61AXXXX4X81417]]></item>
         <item desc="税务登记证号"><![CDATA[]]></item>
         <item desc="社保登记号"><![CDATA[]]></item>
         <item desc="统计证证号"><![CDATA[]]></item>
         <item desc="名称"><![CDATA[XXXX科技有限公司]]></item>
         <item desc="类型"><![CDATA[有限责任公司]]></item>
         <item desc="住所"><![CDATA[XXXXX唐冢湾镇大学路101弓清华科技园A座XXX荦元]]></item>
         <item desc="法定代表人"><![CDATA[叶学兵]]></item>
         <item desc="组成形式"><![CDATA[]]></item>
         <item desc="注册资本"><![CDATA[]]></item>
         <item desc="成立日期"><![CDATA[1999铷3月16日]]></item>
         <item desc="营业期限"><![CDATA[]]></item>
         <item desc="经营范围"><![CDATA[XXXXXXXXXXXXXXXXXXXXXXX]]></item>
         <item desc="登记机关"><![CDATA[]]></item>
         <item desc="登记日期"><![CDATA[]]></item>
         <item desc="二维码"><![CDATA[]]></item>
         <item desc="副本"><![CDATA[]]></item>
      </card>
   </cardsinfo>
</data>

2. json格式说明

下面是二代身份证识别结果示例:

{
  "message":{"status":2,"value":"识别成功"},
  "cardsinfo":[
    {
    "type":"2",
    "items":[
      {"nID":null,"index":null,"desc":"保留","content":""},
      {"nID":null,"index":null,"desc":"姓名","content":"王元青"},
      {"nID":null,"index":null,"desc":"性别","content":"男"},
      {"nID":null,"index":null,"desc":"民族","content":"汉"},
      {"nID":null,"index":null,"desc":"出生","content":"1981-02-21"},
      {"nID":null,"index":null,"desc":"住址","content":"浙江省桐庐县***村二组"},
      {"nID":null,"index":null,"desc":"公民身份号码","content":"3301******02212239"},
      {"nID":null,"index":null,"desc":"头像","content":"头像BASE64编码"}
    ]
    }
  ]
}

下面是银行卡识别结果示例:

{
	"message":{"status":0,"value":"识别完成"},
	"cardsinfo":[
	  {
	  "type":"17",
	  "items":[
		{"nID":null,"index":null,"desc":"卡号","content":"406********56"},
		{"nID":null,"index":null,"desc":"银行卡类型","content":"贷记卡"},
		{"nID":null,"index":null,"desc":"银行卡名称","content":"广发VISA信用卡"},
		{"nID":null,"index":null,"desc":"银行名称","content":"广发银行股份有限公司"},
		{"nID":null,"index":null,"desc":"银行编号","content":"03060000"}
		{"nID":null,"index":null,"desc":"有效日期","content":"11/07"}
	   ]
	   }
	]
}

下面是车牌识别结果示例:

{
	"message":{"status":0,"value":"识别完成"},
	"cardsinfo":[
	{
	 "type":"19",
	 "items":[
		{"nID":null,"index":null,"desc":"车牌号","content":"苏K**309"},
		{"nID":null,"index":null,"desc":"车牌颜色","content":"蓝"},
		{"nID":null,"index":null,"desc":"车牌颜色","content":"1"},
		{"nID":null,"index":null,"desc":"车牌类型","content":"1"},
		{"nID":null,"index":null,"desc":"整牌可信度","content":"83"},
		{"nID":null,"index":null,"desc":"亮度评价","content":"116"},
		{"nID":null,"index":null,"desc":"车牌运动方向","content":"0"},
		{"nID":null,"index":null,"desc":"车牌位置(left_top_right_bottom)","content":"29_3_47_31"}
		]
		}
	]
}

下面是名片识别结果示例:

{
	"message":{"status":0,"value":"识别完成"},
	"cardsinfo":[
	  {
	  "type":"20",
	  "items":[
		{"nID":"0","index":null,"desc":"姓名","content":"王*"},
		{"nID":"1","index":null,"desc":"职务/部门","content":"项目管理中心"},
		{"nID":"1","index":null,"desc":"职务/部门","content":"副总经理"},
		{"nID":"1","index":null,"desc":"职务/部门","content":"兼技术总监"},
		{"nID":"2","index":null,"desc":"手机","content":"1366***034"},
		{"nID":"3","index":null,"desc":"公司","content":"上海中信****有限公司"},
		{"nID":"4","index":null,"desc":"地址","content":"上海市中江路**号"},
		{"nID":"5","index":null,"desc":"电话","content":"021-510766-201"},
		{"nID":"5","index":null,"desc":"电话","content":"800-78-010"},
		{"nID":"6","index":null,"desc":"传真","content":"021-51677"},
		{"nID":"7","index":null,"desc":"电子邮箱","content":"wang.baoqin@cgov"},
		{"nID":"8","index":null,"desc":"网址","content":"http://www.cesgrp.com.cn"},
		{"nID":"9","index":null,"desc":"邮编","content":"200338"},
		{"nID":"9","index":null,"desc":"邮编","content":"490011"}
		]
		}
	]
}

下面是人脸识别结果示例:

{
	"message":{"status":0,"value":"比对完成"},
	"cardsinfo":[
	  {
	  "type":"21",
	  "items":[
	     {"nID":null,"index":null,"desc":"判定值","content":"0.88369954"},
	     {"nID":null,"index":null,"desc":"判定结果","content":"是"}
	     ]
	     }
	  ]
}

下面是人证合一识别结果示例:

{
	"message":{"status":0,"value":"比对完成"},
	"cardsinfo":[
	  {
	  "type":"9999",
	  "items":[
	     {"nID":null,"index":null,"desc":"判定值","content":"0.882316"},
	     {"nID":null,"index":null,"desc":"判定结果","content":"是"},
	     {"nID": null,"index": null,"desc": "保留","content": ""},
	     {"nID": null,"index": null,"desc": "姓名","content": "刘XX"},
	     {"nID": null,"index": null,"desc": "性别","content": "男"},
	     {"nID": null,"index": null,"desc": "民族","content": "汉"},
	     {"nID": null,"index": null,"desc": "出生","content": "19xx-xx-xx"},
	     {"nID": null,"index": null,"desc": "住址","content": "山东省东平县戴庙乡东金山村XXX号"},
	     {"nID": null,"index": null,"desc": "公民身份号码", "content": "370923xxxxxxxx3415"}
	     ]
	  }
	]
}

下面是营业执照结果示例:

选择输出字段1-18按顺序对应输出

{
"message": {"status": 0, "value": "识别完成"},
"cardsinfo": [
    {
       "type": "2008",
       "items": [
           {"nID": null,"index": null,"desc": "统一社会信用代码","content": "911101061786K"},
           {"nID": null,"index": null,"desc": "组织机构代码","content": "61A14X81417"},
           {"nID": null,"index": null,"desc": "税务登记证号","content": ""},
           {"nID": null,"index": null,"desc": "社保登记号","content": ""},
           {"nID": null,"index": null,"desc": "统计证证号","content": ""},
           {"nID": null,"index": null,"desc": "名称","content": "XXX科技有限公司"},
           {"nID": null,"index": null,"desc": "类型","content": "有限责任公司"},
           {"nID": null,"index": null,"desc": "住所","content": "XXX唐冢湾镇大学路座XXX荦元"},
           {"nID": null, "index": null, "desc": "法定代表人","content": "叶学兵"},
           {"nID": null, "index": null,"desc": "组成形式","content": ""},
           {"nID": null,"index": null,"desc": "注册资本","content": ""},
           {"nID": null,"index": null,"desc": "成立日期","content": "1999铷3月16日"},
           {"nID": null,"index": null, "desc": "营业期限","content": ""},
           {"nID": null,"index": null, "desc": "经营范围","content": "XXXXXXXXXXXXXXXXXXX"},
           {"nID": null,"index": null,"desc": "登记机关","content": ""},
           {"nID": null,"index": null,"desc": "登记日期","content": ""},
           {"nID": null,"index": null,"desc": "二维码", "content": ""},
           {"nID": null,"index": null,"desc": "副本","content": ""}
       ]
    }
]
}