QR Code Reader API
QuickChart provides a QR code scanner/reader API that can extract text and data from QR code images. Simply send an image URL or base64-encoded image data to the API endpoint and receive the decoded QR code contents.
API Endpoint
The QR code reader is available at:
https://quickchart.io/qr-read
The endpoint supports both GET and POST requests.
Using GET Request
To scan a QR code from an image URL using GET:
https://quickchart.io/qr-read?url=https://upload.wikimedia.org/wikipedia/commons/0/0b/QR_code_Wikimedia_Commons_%28URL%29.png
The url
parameter should be URL-encoded.
Example response:
{
"result": "http://commons.wikimedia.org/wiki/Main_Page"
}
Using POST Request
The POST endpoint accepts either an image URL or base64-encoded image data.
POST with URL
{
"url": "https://upload.wikimedia.org/wikipedia/commons/0/0b/QR_code_Wikimedia_Commons_%28URL%29.png"
}
POST with Base64 Image
{
"image": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="
}
Example response:
{
"result": "Hello World!"
}
Error Responses
The API returns appropriate HTTP status codes and error messages:
- 400 Bad Request: Missing or invalid parameters
- 405 Method Not Allowed: Unsupported HTTP method
- 500 Internal Server Error: Failed to process the QR code
Example error response:
{
"error": "Please provide either a URL or base64 encoded image"
}
Limitations
- Maximum image size: 10MB
- Request timeout: 10 seconds
- Supported image formats: PNG, JPEG, GIF
- URL must be publicly accessible
tip
For best results, ensure your QR code image is clear and well-lit. The API works best with high-contrast images where the QR code is clearly visible.