
QR & Barcode Scanner API
Utilities
Scan QR codes and barcodes with your camera or from an image. See the decoded text and format, check links before opening them, and read Wi-Fi and contact codes.
Authentication
All API requests require a valid API key passed in the Authorization header as a Bearer token.
Rate Limit
20 requests per minute
Endpoints
1 endpoint available
Overview
Read QR codes and barcodes from an uploaded image. Send the image as multipart/form-data. The
API returns every code it finds, each with its text and what kind of content it holds (link, Wi-Fi network,
contact, email, SMS, phone number, location, one-time-password setup, calendar event, or plain text).
Notes
- Images: PNG, JPEG, WebP, GIF, AVIF or TIFF, up to 10 MB. Large images are shrunk to 3000 pixels on the longest side.
formatuses the same names as the page, such asqr_code,ean_13,code_128,data_matrix,pdf417andaztec.formats(a form field, optional) limits the search:all(default),matrix(QR, Data Matrix, Aztec, PDF417 and similar) orlinear(EAN, UPC, Code 128 and similar).- Up to 20 codes are returned per image.
positionhas the four corner points, in pixels of the decoded image. If nothing is found,countis 0 andcodesis empty. content.kindis one ofurl,wifi,contact,email,sms,tel,geo,otp,eventortext, plus fields for that kind. For links,warningslists problems such as plain http, a fake host before an "@", punycode (look-alike) hostnames and bare IP addresses. Scanned values are untrusted input, so treat links and contact data with care.
Endpoints
POST
https://opentools.ca/api/v1/tools/qr-barcode-scannerRead QR codes and barcodes from an image
Request Body
Content-Type: multipart/form-data
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | file | Required | The image to scan. PNG, JPEG, WebP, GIF, AVIF or TIFF, up to 10 MB. |
| formats | string Enum: all, matrix, linear | Optional | Which kinds of code to look for.Default: all |
Response Example
{
"success": true,
"count": 1,
"codes": [
{
"value": "https://opentools.ca",
"format": "qr_code",
"formatName": "QR Code",
"content": {
"kind": "url",
"url": "https://opentools.ca/",
"host": "opentools.ca",
"warnings": []
},
"position": {
"topLeft": {
"x": 25,
"y": 25
},
"topRight": {
"x": 231,
"y": 25
},
"bottomRight": {
"x": 231,
"y": 231
},
"bottomLeft": {
"x": 25,
"y": 231
}
}
}
]
}Error Codes
400
Bad Request - No file in the file field, an image that cannot be read, or an invalid formats value401
Unauthorized - Invalid or missing API key403
Forbidden - API key inactive, expired, or request from a disallowed IP413
Payload Too Large - Image over 10 MB415
Unsupported Media Type - File is not one of the accepted image types429
Too Many Requests - Rate limit exceeded500
Internal Server ErrorCode Examples
curl -X POST https://opentools.ca/api/v1/tools/qr-barcode-scanner \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "file=@photo.jpg" \
-F "formats=all"Rather use it in your browser? Open the QR & Barcode Scanner