QR Code Reader API

Read the QR code in a PNG or JPEG image; VietQR payment codes are decoded into bank, account number, amount and transfer note.

POSThttps://apibox.io.vn/v1/qr-decode
Images & Codes▶ Try it online

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.

Parameters

NameInTypeRequiredDefault
filebodyfileyesPNG or JPEG image (multipart, raw body or file_base64).

Example

curl -X POST "https://apibox.io.vn/v1/qr-decode" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "0=@./my-file"

Response

{
  "found": true,
  "data": "00020101021238540010A00000072701240006970436011001234567890208QRIBFTTA530370454061500005802VN62260822Thanh toan don ABX12346304FFCC",
  "type": "vietqr",
  "version": 5,
  "image": {
    "format": "png",
    "width": 360,
    "height": 360
  },
  "vietqr": {
    "valid": true,
    "crc_valid": true,
    "bank": {
      "code": "VCB",
      "bin": "970436",
      "short_name": "Vietcombank",
      "name": "Ngân hàng TMCP Ngoại thương Việt Nam"
    },
    "account": "0123456789",
    "amount": 150000,
    "content": "Thanh toan don ABX1234",
    "…": "…"
  }
}

Use cases

  • Read VietQR codes uploaded by merchants and check the bank details
  • Import Wi-Fi or contact QR codes into apps
  • Moderate images that contain QR codes (links)
  • Test generated QR codes in CI

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.

Related APIs

Start with 1,000 free requests every month. Get free API key →