Read QR Code from Image Online
Read the QR code in a PNG or JPEG image; VietQR payment codes are decoded into bank, account number, amount and transfer note.
Result
Press “Run” to see the result.
The QR reader API finds and decodes the QR code in an uploaded image (PNG or JPEG, sent as multipart file, a raw body or file_base64). It handles photos and screenshots, inverted codes and transparent backgrounds, and returns the text, the detected type (URL, Wi-Fi, vCard, e-mail, phone, OTP, EMVCo payment or plain text), the QR version and the position of the code in the image.
Vietnamese payment QR codes are decoded further: a VietQR / NAPAS 247 code gives the bank (name, code and BIN), the account or card number, the amount, the transfer note and whether the CRC is valid, so you can check a payment code before showing or paying it. Wi-Fi codes give the network name, security type and password.
Large photos are scaled down for speed and retried at full size when needed. Images are processed in memory and not stored.
Use this in your code
curl -X POST "https://apibox.io.vn/v1/qr-decode" \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "0=@./my-file"const form = new FormData();
form.append('0', fileInput.files[0]);
const res = await fetch('https://apibox.io.vn/v1/qr-decode', {
method: 'POST',
headers: { Authorization: 'Bearer YOUR_API_KEY' },
body: form,
});
console.log(await res.json());import requests
res = requests.post(
"https://apibox.io.vn/v1/qr-decode",
headers={"Authorization": "Bearer YOUR_API_KEY"},
files={"0": open("my-file", "rb")},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/qr-decode');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
CURLOPT_POSTFIELDS => ['0' => new CURLFile('my-file')],
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));API documentation → Get a free API key
FAQ
What if the image has several QR codes?
The clearest code is returned. Crop the image to read a specific one.
Why is no QR code found?
The code is too small, blurry or cut. Use a sharp image where the code fills a good part of the picture, with its quiet zone around it.
Which formats are supported?
PNG and JPEG up to the file size limit of your plan. Convert HEIC or WebP first.