
营业执照OCR识别
企业用户实名使用个人用户实名使用个人用户无法使用
传入营业执照图片或url地址,识别营业执照基本信息
价格
¥0元/20次
新用户免费体验,自购买起有效期1个月
选择套餐:

接口名称:营业执照OCR识别
描述:上传营业执照照片,扫描文字返回文字信息
请求地址 url:https://api.shuxuntech.com/v1/business/ocr
请求方式 method:post
请求Content-Type: application/x-www-form-urlencoded
参数:
| 名称 | 参数位置 | 类型 | 是否必填 | 说明 |
|---|---|---|---|---|
| appKey | head | string | 是 | 数勋分配appKey |
| timestamp | head | string | 是 | unix时间毫秒值 |
| sign | head | string | 是 | 签名,说明 |
| image | body | string | 否 | 营业执照照片base64,不超过1mb |
| imgUrl | body | string | 否 | 营业执照图片url,不超过1mb |
签名算法说明:
数勋分配的appKey、当前unix时间毫秒值timestamp、数勋分配的appSecret、 按顺序拼接sha256加密得到sign,查看如下示例
appKey = aaa;
timestamp = 1682476904289;
appSecret = bbb;
sign = sha256(appKey+timestamp+appSecret)
正确返回:
{
"code": "0",
"msg": "成功",
"isFee": 1,
"seqNo": "98ik48a942udag92uxvhz1jw2txplza9",
"data": {
"result": 1,
"resultDesc": "识别成功,有数据",
"info": {
"enterpriseType": "有限责任公司(自然人投资或控股)",
"address": "北京市**区西二旗***3号院**号***号",
"registrationCapital": "185,000万(元)",
"opTo": "",
"orgForm": "",
"opScope": "一般项目:技术服务、技术开发、技术咨询、技术交流、技术转让、技术推广;货物进出口;技术进出口;进出口代理;通讯设备销售;厨具卫具及日用杂品批发;厨具卫具及日用杂品零售;个人卫生用品销售;卫生用品和一次性使用医疗用品销售;日用杂品销售;日用百货销售;日用品销售;化妆品批发;化妆品零售;第一类医疗器械销售;第二类医疗器械销售;玩具销售;体育用品及器材零售;体育用品及器材批发;文具用品零售;文具用品批发;鞋帽批发;鞋帽零售;服装服饰批发;服装服饰零售;钟表销售;眼镜销售(不含隐形眼镜);针纺织品销售;家用电器销售;日用家电零售;家具销售;礼品花卉销售;农作物种子经营(仅限不再分装的包装种子);照相机及器材销售;照相器材及望远镜批发;照相器材及望远镜零售;工艺美术品及收藏品零售(象牙及其制品除外);工艺美术品及礼仪用品销售(象牙及其制品除外);计算机软硬件及辅助设备零售;计算机软硬件及辅助设备批发;珠宝首饰零售;珠宝首饰批发;食用农产品批发;食用农产品零售;宠物食品及用品批发;宠物食品及用品零售;电子产品销售;摩托车及零配件零售;摩托车及零配件批发;电动自行车销售;助动自行车、代步车及零配件销售;自行车及零配件零售;自行车及零配件批发;单用途商业预付卡代理销售;商用密码产品销售;五金产品批发;五金产品零售;建筑材料销售;仪器仪表修理;计算机及办公设备维修;办公设备销售;会议及展览服务;组织文化艺术交流活动;广告设计、代理;广告制作;广告发布;摄影扩印服务;票务代理服务;通讯设备修理;移动终端设备制造;可穿戴智能设备制造。(除依法须经批准的项目外,凭营业执照依法自主开展经营活动)许可项目:第三类医疗器械经营;网络文化经营;出版物零售;出版物批发;食品销售;药品零售;广播电视节目制作经营;第一类增值电信业务;第二类增值电信业务;在线数据处理与交易处理业务(经营类电子商务);基础电信业务;互联网信息服务;信息网络传播视听节目。(依法须经批准的项目,经相关部门批准后方可开展经营活动,具体经营项目以相关部门批准文件或许可证件为准)(不得从事国家和本市产业政策禁止和限制类项目的经营活动。)",
"establishingDate": "2010-03-03",
"legalName": "***",
"registrationCode": "",
"opFrom": "",
"creditCode": "9111010855***082Q",
"opPeriod": "",
"enterpriseName": "***科技有限责任公司",
"isCopy": 1
}
}
}
错误返回:
{
"code": "1",
"msg": "参数错误",
"isFee": 0,
"seqNo": null,
"data": null
}
返回字段描述:
| 字段名 | 类型 | 描述 |
|---|---|---|
| code | string | 错误码 |
| msg | string | 错误描述 |
| isFee | int | 是否计费(1:计费,0:不计费) |
| seqNo | string | 调用流水号 |
| data | object | 返回数据 |
data对象说明
| 字段名 | 类型 | 描述 |
|---|---|---|
| result | int | 识别结果 |
| resultDesc | string | 识别结果描述 |
| info | object | 营业执照信息 |
info对象说明
| 字段名 | 类型 | 描述 |
|---|---|---|
| enterpriseType | string | 企业类型 |
| address | string | 地址 |
| registrationCapital | string | 注册资本 |
| opTo | string | 经营结束日期 |
| orgForm | string | 组成形式 |
| opScope | string | 经营范围 |
| establishingDate | string | 成立时间 |
| legalName | string | 企业法人 |
| registrationCode | string | 注册号 |
| opFrom | string | 经营开始日期 |
| creditCode | string | 统一社会信用代码 |
| opPeriod | string | 经营日期开始至结束时间 |
| enterpriseName | string | 企业名称 |
| isCopy | int | 是否为副本, 1:是 0:否 |
result扫描结果说明
| 字段值 | 描述 |
|---|---|
| 1 | 识别成功,有数据 |
| 2 | 识别成功,无数据 |
| 3 | 识别失败,无法正确解析、未按要求传入参数、下载图片超时 |
code错误码说明
| code | 说明 |
|---|---|
| 0 | 成功 |
| 1 | 参数错误 |
| 2 | 无记录 |
| 3 | 第三方服务异常 |
| 4 | 签名错误 |
| 5 | 余额不足 |
| 6 | 调用频率超限 |
| 7 | 账号停用 |
| 8 | 接口已停用 |
| 9 | 联系服务商开通接口权限 |
| 10 | ip不在白名单 |
| 11 | 系统异常 |
| 12 | 实名状态错误 |
| 99 | 其他异常,具体返回为准 |
营业执照OCR
package com.shuxun.data.impl.demo;
import com.shuxun.common.core.util.HttpUtil;
import org.apache.commons.codec.digest.DigestUtils;
import java.util.HashMap;
import java.util.Map;
public class BusinessOcrDemo {
private static final String APP_KEY = "您的appKey";
private static final String APP_SECRET = "您的appSecret";
private static final String API_URL = "https://api.shuxuntech.com/v1/business/ocr";
public static void main(String[] args) {
String timestamp = System.currentTimeMillis()+"";
String sign = DigestUtils.sha256Hex(APP_KEY + timestamp + APP_SECRET);
Map<String, String> header = new HashMap<>(4);
header.put("appKey", APP_KEY);
header.put("timestamp", timestamp);
header.put("sign", sign);
Map<String, String> params = new HashMap<>(2);
params.put("image", "");
params.put("imgUrl", "");
// 工具类下载地址 https://file.shuxuntech.com/other/code/util.zip
String result = HttpUtil.postForm(API_URL, header, params);
System.out.println("返回结果="+result);
}
}
import requests
import time
import hashlib
appKey = "您的appKey"
appSecret = "您的appSecret"
url = "https://api.shuxuntech.com/v1/business/ocr"
method = 'POST'
time = time.time()
timestamp = str(round(time * 1000))
print (timestamp)
tmp = appKey + timestamp + appSecret
sign = hashlib.sha256(tmp.encode("utf8")).hexdigest()
headers = {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
'appKey': appKey
'timestamp': timestamp
'sign': sign
}
params = {}
params['image'] = ''
params['imgUrl'] = ''
response = requests.post(url, data = params, headers = headers)
print (response.text)
<?php
$appKey = "您的appKey";
$appSecret= "您的appSecret";
$url = "https://api.shuxuntech.com/v1/business/ocr";
$method = "POST";
$timestamp = getUnixTimestamp();
var_dump($timestamp);
$sign = hash('sha256',$appKey . $timestamp . $appSecret);
var_dump($sign);
$headers = array();
array_push($headers, "Content-Type" . ":" . "application/x-www-form-urlencoded; charset=UTF-8");
array_push($headers, "appKey" . ":" . $appKey);
array_push($headers, "timestamp" . ":" . $timestamp);
array_push($headers, "sign" . ":" . $sign);
$image = "";
$imgUrl = "";
$bodys = "image=" . $image . "&imgUrl=" . $imgUrl;
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, $bodys);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
if (1 == strpos("$".$url, "https://")) {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
}
var_dump(curl_exec($curl));
function getUnixTimestamp () {
list($s1, $s2) = explode(' ', microtime());
return sprintf('%.0f',(floatval($s1) + floatval($s2)) * 1000);
}
using System;
using System.IO;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
public class ApiDemo {
private const String url = "https://api.shuxuntech.com/v1/business/ocr";
private const String method = "POST";
private const String appKey = "您的appKey";
private const String appSecret = "您的appSecret";
public static void Main(string[] args) {
TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0);
String timestamp = Convert.ToInt64(ts.TotalMilliseconds).ToString();
String sign = SHA256(appKey + timestamp + appSecret);
HttpWebRequest httpRequest = null;
HttpWebResponse httpResponse = null;
httpRequest = (HttpWebRequest) WebRequest.CreateDefault(new Uri(url));
httpRequest.Method = method;
httpRequest.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
httpRequest.Headers.Add("appKey", appKey);
httpRequest.Headers.Add("timestamp", timestamp);
httpRequest.Headers.Add("sign", sign);
String image = "";
String imgUrl = "";
String params = "image=" + image + "&imgUrl=" + imgUrl;
byte[] data = Encoding.UTF8.GetBytes(params);
using (Stream stream = httpRequest.GetRequestStream()) {
stream.Write(data, 0, data.Length);
}
httpResponse = (HttpWebResponse) httpRequest.GetResponse();
Console.WriteLine(httpResponse.StatusCode);
Stream st = httpResponse.GetResponseStream();
StreamReader reader = new StreamReader(st, Encoding.GetEncoding("utf-8"));
Console.WriteLine(reader.ReadToEnd());
}
public static string SHA256(string str) {
byte[] SHA256Data = Encoding.UTF8.GetBytes(str);
SHA256Managed Sha256 = new SHA256Managed();
byte[] by = Sha256.ComputeHash(SHA256Data);
return BitConverter.ToString(by).Replace("-", "").ToLower();
}
}
java
python
php
c#
产品详情
API文档
示例代码
产品价格










