QR code scanning API powered by QReader, packaged as a Docker image.
You only need Docker Desktop (or Docker Engine) installed. No Python installation is required.
docker pull ghcr.io/Poheart/qreader-api:latest
docker run -d \
--name qreader-api \
--restart unless-stopped \
-p 8000:8000 \
ghcr.io/Poheart/qreader-api:latestThe first startup can take up to a minute while the QR model loads. Check that it is ready:
curl http://localhost:8000/healthThe API is available at http://localhost:8000. Open http://localhost:8000/docs for interactive API documentation.
Replace qr.png with the path to an image containing a QR code:
curl -X POST \
-F "imageFile=@qr.png" \
http://localhost:8000/scanExample response:
{
"Successful": true,
"BarcodeType": "QR_CODE",
"RawText": "https://example.com"
}To return every QR code found in the image, use /scan/advanced:
curl -X POST \
-F "imageFile=@qr.png" \
http://localhost:8000/scan/advanceddocker stop qreader-api
docker rm qreader-apiView startup and request logs with:
docker logs -f qreader-apiTo build the image locally instead of pulling it from GHCR:
docker compose up --buildThe API will be available at http://localhost:8000, with interactive docs at http://localhost:8000/docs.
Simple scan — returns the first QR code found. Send the image as the imageFile multipart form field.
Advanced scan — returns all QR codes found in the image.
{
"Successful": true,
"ResultBarcodes": [
{ "RawText": "https://example.com", "BarcodeType": "QR_CODE" }
],
"BarcodeCount": 1,
"ErrorMessage": null
}curl http://localhost:8000/health| Variable | Default | Description |
|---|---|---|
API_KEY |
(unset) | If set, requires Apikey header on scan endpoints |
MODEL_SIZE |
s |
QReader model size: n, s, m, or l |
MAX_UPLOAD_SIZE_MB |
5 |
Maximum upload file size in MB |
Pass environment variables when starting the published image:
docker run -d \
--name qreader-api \
-p 8000:8000 \
-e MODEL_SIZE=s \
-e MAX_UPLOAD_SIZE_MB=10 \
ghcr.io/Poheart/qreader-api:latestdocker build -t qreader-api .
docker run -p 8000:8000 qreader-apidocker run -p 8000:8000 -e API_KEY=your-secret-key qreader-apiThen include the Apikey header in requests:
curl -X POST -H "Apikey: your-secret-key" -F "imageFile=@qr.png" http://localhost:8000/scan/advancedWhen using the published image, replace qreader-api in the command with ghcr.io/Poheart/qreader-api:latest.
Images are published automatically on pushes to main (tagged latest) and on version tags (v*).
docker pull ghcr.io/Poheart/qreader-api:latest