Transform - Encoding

Free QR Code Decode API Endpoint

The free QR code decode API endpoint reads a QR image and hands back the text inside it. Send the picture as base64 in a JSON body, or upload the file itself. One POST, one field in the reply.

  • No API key
  • Base64 or file upload
  • One response field
  • Image in, text out

Decode a QR code

POST/qrcode_decode

https://aisenseapi.com/services/v1/qrcode_decode

Want to see it answer before you write code? The free QR code decoder API tool posts to this same endpoint from your browser - drop or paste an image and it prints the raw response. It reads barcodes as well as QR codes.

Send a base64 image

Put the base64 of your QR image in a JSON field named payload. The service decodes the string, looks for a code and returns what it holds.

curl -X POST https://aisenseapi.com/services/v1/qrcode_decode \
  -H "Content-Type: application/json" \
  -d '{"payload":"iVBORw0KGgoAAAANSUhEUg..."}'
{
  "qrcode_content": "https://aisense.no/free-public-apis"
}

That call round-trips a code produced by the QR Code encode API endpoint. Its qrcode_image field is already base64, so the value drops straight into payload with no conversion step in between.

Upload the file instead

A multipart request works just as well, and it saves you the encoding step. Name the file field qrcode_image. It is also the way to send a large image: a file upload may be 10 MB, while a JSON body stops at 256 KiB.

curl -X POST https://aisenseapi.com/services/v1/qrcode_decode \
  -F "qrcode_image=@qr.png"
{
  "qrcode_content": "https://aisense.no/free-public-apis"
}

The field name matters. Post the same file under the name file and the request fails with HTTP 400 rather than falling back to a guess.

Response field

FieldTypeDescription
qrcode_contentstringThe exact text carried by the QR code. A URL comes back as a URL, a serial number as a serial number.

A successful call returns that field and nothing else. There is no confidence score, no bounding box and no image metadata in the reply, so parsing stays trivial.

Errors from the free QR code decode API endpoint

A failure comes back with error, saying which stage broke, and fix, a sentence saying what to send instead.

StatusMessageCause
400No valid payload. Provide a file or base64 imageNeither payload nor a file named qrcode_image reached the service.
400Invalid base64 payloadThe string in payload is not valid base64.
400No QR code or barcode was found in the image.The image opened fine but held no readable code.
400The image could not be read.The file starts like an image but does not open as one.
413The file is ... The limit is 10 MB.The image is over 10 MB, or over 25 megapixels.
413Request body too large. Maximum 256 KB.The JSON body with the base64 is over 256 KiB. Upload the image as qrcode_image instead.
415Only PNG, JPEG, GIF and WebP images are accepted.The file is something else, a PDF for example.
503Image service is busyTwo images are being worked on already. Try again after the seconds in Retry-After.

One gotcha is worth memorising. The base64 must be raw, so a data:image/png;base64, prefix in front of the string is rejected as invalid base64. Strip everything before the comma and post only the tail.

No QR code or barcode was found separates a transport problem from a picture problem. If you see it, the bytes arrived intact and the scan simply found nothing, which usually means a crop, a blur or too little quiet zone around the code.

Common uses

Document intake

Pull the reference number off a scanned invoice or delivery note.

Ticket checks

Read the token printed on a pass before you validate it in your own system.

Inventory moves

Turn a shelf photo into the identifier your warehouse database expects.

Agent tooling

Let a language model hand over an image and receive plain text it can reason about.

Limits and safe handling

A QR code is an encoding format, not a security control. Anyone who can scan the image can read the same payload you just decoded.

Treat whatever the free QR code decode API endpoint returns as untrusted input. Validate a decoded URL before you open it, and escape the string before you print it into a page or a shell command.

The image is a PNG, JPEG, GIF or WebP of at most 10 MB and 25 megapixels when you upload the file. A JSON body is at most 256 KiB in total on every endpoint, and base64 makes an image a third larger, so through payload the image can be about 190 KB. Upload anything larger as a file. Anything else, a PDF included, is refused with HTTP 415 before it is opened, so a code in a PDF is read by sending the page as an image. At most two images are worked on at a time across the image endpoints; a third waits up to ten seconds and is then answered 503 with Retry-After.

Images travel in the request body, never in the URL, so they stay out of access logs and referrer headers. The service-wide limit is 5000 requests per IP per day, and no key or account is needed to reach it.

Need the other direction, or a different alphabet? The Encoding APIs hub collects every transform on one page, and the full free public REST APIs reference lists the rest of the catalogue.