https://api.qrserver.com/v1/read-qr-code/?fileurl={url}https://api.qrserver.com/v1/read-qr-code/?fileurl=https://api.qrserver.com/v1/create-qr-code/%3Fdata%3Dhello和广场里的「二维码生成」正好相反:给图片地址,返回编码进去的文本。
url 填二维码图片的完整地址(jpg/png/gif 都行),返回是数组,第一项的 symbol[0].data 就是内容。识别失败时 data 为空、error 有原因。
图片必须是公网可直接访问的直链,需要登录或带防盗链的地址读不到。二维码倾斜、反色、带 logo 也能识别,但分辨率低于 100 像素成功率会明显下降。
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
url |
string | 必填 | https://api.qrserver.com/v1/create-qr-code/?data=hello | 二维码图片的直链地址 |
https://api.qrserver.com/v1/read-qr-code/?fileurl={url}
此处将显示接口返回结果…
[
{
"type": "qrcode",
"symbol": [ { "seq": 0, "data": "hello", "error": null } ]
}
]
—