Scan QR Code API Overview
Scan QR Code API detects and decodes QR codes from PDF documents, scanned files, and even photographed QR codes in various image formats (PNG, JPG, TIFF). You can enable multiple barcode detection, try intensive detection algorithms, and handle inverted or rotated barcodes. The result is returned as JSON with decoded values and optional metadata.
Lightning Fast Conversions
Process and convert files in seconds with our high-performance cloud infrastructure.
Accuracy Guaranteed
Our advanced algorithms ensure pixel-perfect and content-accurate file conversions.
Enterprise-Grade Security
ISO 27001, HIPAA, and GDPR compliant with encrypted file processing.
Global Infrastructure
Strategically located servers ensure low latency and high availability worldwide.
Developer Friendly
Comprehensive SDKs and clear documentation for quick and simple integration.
Time-Saving Automation
Automate repetitive document workflows and focus on what matters most.
Customizable Parameters
Fine-tune your automation with these powerful conversion options
File
File Supported formats: .pdf .png .jpg .tiffFile to be converted. Value can be URL or file content.
Password
StringSets the password to open protected PDF.
PageRange
String Default: 1-2000Set PDF page range to convert. Example 1-10 or 1,2,5.
DetectMultiple
Bool Default: FalseIf set to true, the converter will attempt to detect multiple barcodes.
EnhancedDetection
Bool Default: FalseIf set to true, the converter will use more intensive algorithms to detect barcodes.
IncludeInverted
Bool Default: FalseIf set to true, the converter will also try to detect barcodes with inverted colors.
AutoRotate
Bool Default: FalseIf set to true, the converter will automatically rotate the view to detect barcodes.
StoreFile
Bool Default: FalseWhen the StoreFile parameter is set to True, your converted file is written to ConvertAPI’s encrypted, temporary storage and made available via a time-limited secure download URL, valid for up to 3 hours. After this period, the file is permanently deleted.
When StoreFile is set to False, conversion happens entirely in-memory. The raw file bytes are streamed back in the API response without touching disk or external storage, ensuring maximum security and zero persistence so that only you can access the content.
Integrate using REST-API
Ready-to-run code samples for quick conversion and automation.
How it works
- The source file is passed to the converter and API scans for QR codes.
- Each detected QR code is decoded.
- Results are returned as a JSON array, where each object represents one detected QR code.
How to perform the conversion
You can call the converter via a standard HTTP POST request. Below is an example using curl:
curl -X POST "https://v2.convertapi.com/convert/qrcode/to/data" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-F "File=@/path/to/your/file.pdf" \
-F "StoreFile=true"Output JSON
The QR code data is returned as a JSON file in the API response.
After conversion, the API returns a standard ConvertAPI response containing a Files array.
Each file entry includes a Url where you can download the generated JSON file.
API response example
{
"ConversionCost": 1,
"Files": [
{
"FileName": "QRCode.json",
"FileExt": "json",
"FileSize": 584,
"FileId": "jesmx8nz3ax37psd99ch6jjhuwwvfj31",
"Url": "https://v2.convertapi.com/d/jesmx8nz3ax34psd88ch6jjhuwwvfj12/QrCode.json"
}
]
}Downloaded JSON file content
The downloaded JSON file contains the actual QR code detection results:
[
{
"Text": "https://www.convertapi.com",
"Format": "QRCode",
"RawBytes": "QaaHR0cHM6Ly93d3cuY29udmVydGFwaS5jb20OwR7BHsEQ==",
"Metadata": {
"QrMaskPattern": "6",
"ErrorCorrectionLevel": "L",
"ErrorsCorrected": "0",
"SymbologyIdentifier": "]Q1",
"Orientation": "0"
},
"Points": [
{
"X": 120,
"Y": 480
},
{
"X": 120,
"Y": 120
},
{
"X": 480,
"Y": 120
},
{
"X": 420,
"Y": 420
}
]
}
]
If multiple QR codes are found, the array contains multiple objects.
Field reference
Text - The decoded human-readable QR code value.
This is usually the main field your application will consume. For example, it may contain a URL, identifier, payload, or encoded data embedded in the QR code.
Format - The detected barcode format.
For this converter, the value will always be QRCode.
RawBytes - Base64-encoded raw bytes returned by the decoder.
This field is useful when you need access to the original decoded byte payload, not just the text representation. It is not guaranteed to be present for every QR code.
Metadata - Additional decoder-provided information about the detected QR code.
The exact fields may vary depending on what information is available for the detected symbol.
Metadata fields include:
QrMaskPatternSymbologyIdentifierOrientationErrorCorrectionLevelErrorsCorrected
Because metadata is format-dependent, client code should treat this object as extensible and avoid assuming that every field is always present.
Points - Coordinates describing where the QR code was detected in the source image or page.
Each point contains:
XY
QR codes typically return 4 points.
Summary
The Scan QR Code API returns a clean, developer-friendly JSON structure.
Integrate within minutes
Easy Scan QR Code automation using our simple REST-API
Businesses trust us
Highest rated File Conversion API on major B2B software listing platforms: Capterra, G2, and Trustpilot.
"ConvertAPI has been a game-changer for our document automation workflows. Their conversion accuracy and API reliability are unmatched in the industry for over 7 years."
"ConvertAPI is a reliable, cost-effective solution with a proven track record of stability. It has grown significantly in maturity, adopting enterprise-grade practices over the years."
"We've integrated ConvertAPI across our entire document processing platform. The performance is exceptional and the support team is always responsive. Highly recommended!"
Enterprise-Grade Security
We ensure that all document processing is handled securely in the cloud, adhering to industry-leading standards like ISO 27001, GDPR, and HIPAA. To enhance security even further, we can ensure that no files or data are stored on our servers and never leave your country.
Learn more about security