## 图片验证码识别(停售) ![](https://img.kancloud.cn/ee/d7/eed7e93667e6c2c115efcea8b7126c2f_199x200.png) > 提供可识别中、英、数或混搭的验证码。本验证码仅为残障人士提供验证码识别服务,并不针对任何网站或个人。 ## 接口调用([调用须知](https://docs.topthink.com/think-api/1835086)) ### `typeId`参数说明 > 注意:最大支持10位的验证码。 > > 1.纯数字 > typeId=10 任意长度数字,识别率会降低 > typeId=11 1位数字 > typeId=12 2位数字 > ... > typeId=19 9位数字 > > 2.纯英文 > typeId=20 任意长度英文,识别率会降低 > typeId=21 1位英文 > typeId=22 2位英文 > ... > typeId=29 9位英文 > > 3.英文数字混合 > typeId=30 任意长度英数混合,识别率会降低 > typeId=31 1位英数 > typeId=32 2位英数混合 > ... > typeId=39 9位英数混合 > > 4.纯汉字 > typeId=40 任意长度汉字混合,识别率会降低 > typeId=41 1位汉字 > typeId=42 2位汉字 > ... > typeId=49 9位汉字 > > 5.数字英文汉字混合 > typeId=50 任意长度中英数三混 ## 接口1:数字验证码识别( [点击购买](https://market.topthink.com/product/317)) > 最低 0.01元/次 ## 接口调用 ### 请求地址 ``` GET https://api.topthink.com/captcha/number ``` ### 请求参数 | 参数名称 | 类型 | 默认值 | 示例值 | 必须 | 描述 | | --- | --- | --- | --- | --- | --- | | appCode| string| 是|用户授权码,参考[API调用](https://docs.topthink.com/think-api/1835086) | | imgBase64 | String | | | 是 | 图片文件的base64字符串。图片大小需要小于100KB。 | | typeId | String | | 34 | 是 | 注意:最大支持10位的验证码。并尽量输入确定位数,不然识别率及速度都会降低。 | | convertToJpg | String | | 0 | 否 | 有少量png或gif图转成jpg格式后识别率明显提高(并不是所有png或gif转成jpg后都会提高识别率)。 此字段为1时表示需要把图片转为jpg格式,其他值不做转换操作。 | | needMorePrecise | String | | 0| 否 | 是否开启精准识别,1表示开启 0不开启,默认值为0; 如果开启精准识别,会降低识别的速度 | ### 返回`data`参数 | 名称 | 类型 | 示例值 | 描述 | | --- | --- | --- | --- | | Result | String | 6nr9a | 识别出来的字符 | ## SDK调用 ``` $client = new Client("YourAppCode"); $result = $client->captchaNumber() ->withImgBase64('') ->withTypeId(16) ->request(); ``` 返回示例: ~~~ { "code":0, "message": "成功", "data": { "Result": "6nr9a", } } ~~~ ## 接口2:中英文验证码识别( [点击购买](https://market.topthink.com/product/318)) > 最低 0.03元/次 ## 接口调用 ### 请求地址 ``` GET https://api.topthink.com/captcha/chinese ``` ### 请求参数 | 参数名称 | 类型 | 必须 | 描述 | | --- | --- | --- | --- | | appCode| 是 |string| 是|用户授权码,参考[API调用](https://docs.topthink.com/think-api/1835086) | | imgBase64 | String | 是 | 图片文件的base64字符串。图片大小需要小于100KB。 | | typeId | String | 是 | 注意:最大支持10位的验证码。并尽量输入确定位数,不然识别率及速度都会降低。 | | convertToJpg | String | 否 | 有少量png或gif图转成jpg格式后识别率明显提高(并不是所有png或gif转成jpg后都会提高识别率)。 此字段为1时表示需要把图片转为jpg格式,其他值不做转换操作。 | ### 返回`data`参数 | 名称 | 类型 | 示例值 | 描述 | | --- | --- | --- | --- | | Result | String | 6nr9a | 识别出来的字符 | ## SDK调用 ``` $client = new Client("YourAppCode"); $result = $client->captchaChinese() ->withImgBase64('') ->withTypeId(44) ->request(); ``` 返回示例: ~~~ { "code":0, "message": "成功", "data": { "Result": "6nr9a", } } ~~~ ## 接口3:算术验证码识别( [点击购买](https://market.topthink.com/product/319)) 可识别加减乘除类型的简单算术验证码,算术码的数字范围应小于999 。 > 最低 0.02元/次 ## 接口调用 ### 请求地址 ``` GET https://api.topthink.com/captcha/algorism ``` ### 请求参数 | 参数名称 | 类型 | 必须 | 描述 | | --- | --- | --- | --- | | appCode| string| 是|用户授权码,参考[API调用](https://docs.topthink.com/think-api/1835086) | | imgBase64 | String | | | 是 | 图片文件的base64字符串。图片大小需要小于100KB。 | ### 返回`data`参数 | 名称 | 类型 | 示例值 | 描述 | | --- | --- | --- | --- | | Result | String | 12| 比如图形是2\*6=? ,那么返回结果将是12 | ## SDK调用 ``` $client = new Client("YourAppCode"); $result = $client->captchaAlgorism() ->withImgBase64('') ->request(); ``` 返回示例: ~~~ { "code":0, "message": "成功", "data": { "Result": "12", } } ~~~