Decode a QR Code Image
Send the image to https://api.2dcode.biz/v1/read-qr-code. No credentials are required.
Read an image from a URL
Pass its URL in the file_url query parameter. This example lets curl URL-encode the parameter value.
bash
curl --get 'https://api.2dcode.biz/v1/read-qr-code' \
--data-urlencode 'file_url=https://gstatic.clewm.net/caoliao-resource/250408/80bc7c_bd33d499.png'Upload a local image
Use POST with a multipart form field named file.
python
import requests
with open("qrcode.png", "rb") as image:
response = requests.post(
"https://api.2dcode.biz/v1/read-qr-code",
files={"file": image},
)
response.raise_for_status()
print(response.json()["data"]["contents"])Response
json
{"code": 0, "message": "ok", "data": {"contents": ["Example"]}}A code of 0 indicates success. The message field describes the result. The data.contents array contains one string per decoded QR code and is empty if the image contains none.