apyhub
Back
DATA EXTRACTION · DEVELOPER TOOLS

Decode QR & Barcode API

What it does

QR Code Scanner reads every QR code and barcode in an image and returns the decoded symbols in reader order. Send either image_base64 or image_url, and optionally limit detection with formats or return only the first match with multiple set to false.

Use it when you need to extract product labels from packaging photos, decode QR tickets from screenshots, or process receipts and shipping labels at scale. The reader supports common symbologies including QR, Data Matrix, PDF417, Aztec, Code 128, EAN-13, UPC-A, and more.

The response includes a count plus a results array. Each result contains the decoded text, format, content_type, position, and orientation, along with optional parsed data for known payloads such as Wi-Fi, vCard, EPC, and crypto formats. QR symbols also include ec_level, and binary payloads can be returned as bytes_base64 when the raw bytes differ from the text.

If you are building document intake, inventory scanning, ticketing, or mobile image analysis, QR Code Scanner gives you the decoded content and symbol location from a single image request.

POST
Read every QR code and barcode in an image
https://api.eu.apyhub.com/callable-labs/read-qr-barcode-image/decode

QUICKSTART

GUIDE

Quickstart

Decode a QR code or barcode from an image by sending either an image URL or base64 image data.

curl -X POST "https://api.eu.apyhub.com/callable-labs/read-qr-barcode-image/decode" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "image_url": "https://cdn.phototourl.com/free/2026-09-16-eaa7b05b-0601-419d-802f-9567cf8fda07.png"
  }'

What you'll get back

Returns a JSON object with a count integer and a results array. count is the number of symbols decoded, and each item in results is an object with format, text, content_type, position, and orientation fields, plus optional decoded details like parsed, ec_level, bytes_base64, and symbology_identifier.

{
  "count": 1,
  "results": [
    {
      "format": "qr",
      "text": "Hello ApyHub",
      "content_type": "text",
      "position": {
        "top_left": [1, 1],
        "top_right": [199, 0],
        "bottom_right": [200, 200],
        "bottom_left": [0, 199]
      },
      "orientation": 0,
      "ec_level": "L",
      "symbology_identifier": "]Q1"
    }
  ]
}
TRY ITLIVE · 20 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Supply exactly one of `image_base64` or `image_url`.
By image URL*
Public HTTP(S) URL of the image to decode. Supply exactly one of `image_base64` or `image_url`. Fetched over a size-guarded, SSRF-protected connection; max 5 MB.

About this endpoint

What it does

Decodes every QR code and barcode found in an image and returns the decoded symbols in reader order. You can supply the image either as a public URL or as base64, and optionally restrict decoding to specific symbologies.

Request Body

ParameterTypeMandatoryDescription
image_base64StringYes (if image_url is not provided)Image to decode as base64: PNG, JPEG, WebP, GIF, BMP or TIFF, with or without a data: prefix. Supply exactly one of image_base64 or image_url. Max 5 MB.
image_urlStringYes (if image_base64 is not provided)Public HTTP(S) URL of the image to decode. Supply exactly one of image_base64 or image_url. Fetched over a size-guarded, SSRF-protected connection; max 5 MB.
formatsString ArrayNoRestrict detection to these symbologies for speed and accuracy: qr, microqr, datamatrix, pdf417, aztec, code128, code39, code93, ean13, ean8, upca, upce, itf, codabar, databar, maxicode. Omit to scan every supported symbology. Unknown values return bad_image.
multipleBooleanNoReturn every symbol found. Default true. Set false to return only the first symbol.

Response

Returns a JSON object with a count integer field and a results array field. count is the number of symbols decoded, and each item in results is an object describing one decoded symbol and the data recovered from it.

ParameterTypeMandatoryDescription
countIntegerYesNumber of symbols decoded.
resultsObject ArrayYesDecoded symbols, in reader order.
results[].formatStringYesSymbology of the symbol, e.g. qr, microqr, datamatrix, pdf417, aztec, code128, ean13 or upca.
results[].textStringYesDecoded text of the symbol.
results[].content_typeStringYesClassification of the text: url, wifi, vcard, mecard, email, sms, tel, geo, event, whatsapp, epc, crypto or text.
results[].positionObjectYesFour corner points in pixels: top_left, top_right, bottom_right and bottom_left, each as [x, y].
results[].orientationIntegerYesRotation of the symbol in degrees.
results[].parsedObjectNoFields recovered for known content types, e.g. ssid/password/security for Wi-Fi, name/email/phone for vCard, iban/name/amount for EPC/SEPA. null when the type has no structured fields.
results[].ec_levelStringNoError-correction level (L, M, Q, H) for QR symbols, otherwise null.
results[].bytes_base64StringNoBase64 of the raw bytes when they differ from the text (binary payloads), otherwise null.
results[].symbology_identifierStringNoISO/IEC 15424 symbology identifier, e.g. ]Q1, when available.

Notes

The image source is limited to 5 MB whether you send image_base64 or image_url. Images are downscaled to 4096 px on the longest side, and transparency is flattened onto white so transparent codes still read. When using image_url, the image is fetched over an SSRF-protected connection, and formats only accepts the listed symbologies; unknown values return bad_image.

Body

Name
Type
Description
bodyREQUIRED
object
Supply exactly one of `image_base64` or `image_url`.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.