QR Code Decode API Endpoint - Free Public API
Endpoint URL:
https://aisenseapi.com/services/v1/qrcode_decode
Description:
This endpoint decodes the content from a QR code image. It accepts input as a file upload or as a Base64-encoded image in JSON format. The API extracts the content from the QR code and returns it as a JSON response. If decoding fails, an appropriate error message is returned.
Response Format
- Content-Type:
application/json
Example Success Responses
Example: URL
{ “qrcode_content”: “https://aisenseapi.com/” }
Example: Plain text
{ “qrcode_content”: “Hello, world!” }
Example: vCard (Contact Information)
{ “qrcode_content”: “BEGIN:VCARD\nFN:John Doe\nTEL:+1234567890\nEND:VCARD” }
Example: Wi-Fi Credentials
{ "qrcode_content": "WIFI:S:MyNetwork;T:WPA;P:mypassword;; }
Example: Event Details
{ "qrcode_content": "BEGIN:VEVENT\nSUMMARY:Meeting\nDTSTART:20230401T100000\nDTEND:20230401T110000\nEND:VEVENT }
Example Error Responses
{ "error": "Invalid base64 payload" }{ "error": "No valid payload. Provide a file or base64 image" }{ "error": "QR decoding failed: Unknown error" }
Input Requirements
The API accepts input in two formats:
- File Upload (QR Code Image)
- The file must be sent as
multipart/form-dataunder the keyqrcode_image. - The API will attempt to decode the QR code from the image.
- The file must be sent as
- Base64-encoded QR code image
- The file must be sent as
application/jsonunder the keyqrcode_image. - Input must be a valid Base64-encoded PNG image wrapped in JSON.
{ "payload": "iVBORw0KGgoAAAANSUhEUg..." }- The image will be temporarily stored, processed, and deleted after decoding.
- The file must be sent as
Use Cases
- Extracting QR code content from uploaded images.
- Decoding Base64-encoded QR code images.
- Automating QR code scanning in applications.
How to Use
1. Send a POST request to
https://aisenseapi.com/services/v1/qrcode_decode
2. Choose your input format
- File upload
[...data from file...]- The file must be sent as
multipart/form-dataunder the keyqrcode_image.
- The file must be sent as
- Base64-encoded QR code image
{ "payload": "iVBORw0KGgoAAAANSUhEUg..." }
3. Handle the response
- If the QR code is valid, the response contains the decoded QR code content.
- If the input is missing or invalid, an error message is returned.
Example cURL Requests
Decode QR Code from an Uploaded File
curl -X POST https://aisenseapi.com/services/v1/qrcode_decode \
-F "qrcode_image=@/path/to/qrcode.png"
Decode QR Code from a Base64 Image
curl -X POST https://aisenseapi.com/services/v1/qrcode_decode \
-H "Content-Type: application/json" \
-d '{"payload":"iVBORw0KGgoAAAANSUhEUg..."}'
Key Features
- Supports both file uploads and Base64-encoded images
- Extracts QR code content from images
- Ensures clear error handling for invalid input
- No authentication required – free public API