## 二维码解码 ![](https://img.kancloud.cn/4a/d5/4ad5df6cbb7f48844fa89d5afd5cb3a0_200x200.png) > 请传递图片base64编码数据或图片地址(任选其一),自动识别常见的二维码类型。请注意:该接口请使用POST方式请求,base64数据大小不超过300k。在保证图片清晰度的情况下,图片越小识别速度越快,结果也越稳定。 ## 接口费用( [点击购买](https://market.topthink.com/product/216)) > 最低 0.02元/次 ## 接口调用([调用须知](https://docs.topthink.com/think-api/1835086)) ### 请求地址 ``` GET https://api.topthink.com/qrcode/codec ``` ### 请求参数 | 名称 | 类型 | 必填 | 说明 | | --- | --- | --- | --- | | appCode| string| 是|用户授权码,参考[API调用](https://docs.topthink.com/think-api/1835086) | | qrpic | string | 否 | 二维码图片的base64编码 | | qrurl | string | 否 | 二维码图片地址 | ### 返回`data`参数 | 名称 | 类型 | 示例值 | 说明 | | --- | --- | --- | --- | | qrtype | string | WeChat | 二维码类型 | | qrcodec | string | http://weixin.qq.com/r/nEx-ZyfEaXoWrWME9xmO | 二维码内容 | ## SDK调用 ``` $client = new Client("YourAppCode"); $result = $client->qrcodeCodec() ->withQrurl('https://img.kancloud.cn/73/07/7307977f30ed15f758049a093d9927e0_400x400.png') ->request(); ``` 返回示例: ~~~ { "code":0, "message": "成功", "data": [ { "qrtype": "Url", "qrcodec": "https://weekly.thinkphp.cn" } ] } ~~~