| 参数名称 | 类型 | 必填 | 说明 |
|---|---|---|---|
| pic | file/string | 是 | 图片文件 POST上传,支持传base64格式的图片内容 JPG识别率略高 |
| type | string | 是 | 文字类型 cnen中英文 en英语 fr法语 pt葡萄牙语 de德语 it意大利语 es西班牙语 ru俄语 jp日语 |
| 参数名称 | 类型 | 说明 |
|---|---|---|
| result | string | 识别结果 |
<?php
require_once 'curl.func.php';
$appkey = 'your_appkey_here';//你的appkey
$url = "https://api.binstd.com/generalrecognition/recognize?appkey=$appkey";
$post = array(
'type'=>'cnen',
'pic'=>base64_encode(file_get_contents('sfz1.jpg')), //'@'.realpath('11.jpg')
);
$result = curlOpen($url, array('post'=>$post, 'isupfile'=>true));
$jsonarr = json_decode($result, true);
if($jsonarr['status'] != 0)
{
echo $jsonarr['msg'];
exit();
}
$result = $jsonarr['result'];
foreach($result as $key=>$val)
{
echo $key.' '.$val. '
';
}
{
"status": "0",
"msg": "ok",
"result": [
"此时此刻我好焦灼!",
"你别再解释了"
]
}
| 代号 | 说明 |
|---|---|
| 201 | 图片为空 |
| 202 | 图片格式错误 |
| 208 | 识别失败 |
| 210 | 没有信息 |
| 代号 | 说明 |
|---|---|
| 101 | APPKEY为空或不存在 |
| 102 | APPKEY已过期 |
| 103 | APPKEY无请求此数据权限 |
| 104 | 请求超过次数限制 |
| 105 | IP被禁止 |
| 106 | IP请求超过限制 |
| 107 | 接口维护中 |
| 108 | 接口已停用 |
| 名称 | 权限 | 价格 | |
|---|---|---|---|
| 免费套餐 | 5次 | 免费 | |
| Level1 | 20000次 | 230.00元 | |
| Level2 | 50000次 | 560.00元 | |
| Level3 | 70000次 | 760.00元 |
开通账号: