QR Code encode API Endpoint - Free Public API

Endpoint URL:

https://aisenseapi.com/services/v1/qrcode_encode

Description:

This endpoint generates a QR code from a given text input. It accepts a JSON payload containing the text to encode and returns the QR code image as a Base64-encoded PNG. QR codes can encode not only URLs but also plain text, contact information, Wi-Fi credentials, event details, and more.

If the input is invalid or missing, an appropriate error message is returned.

Response Format

  • Content-Type: application/json

Example Success Response

{
"qrcode_image": "iVBORw0KGgoAAAANSUhEUg...",
"image_type": "png"
}

Example Error Responses

{ "error": "No payload." }

Input Requirements

The API accepts input as JSON: json

{ "payload": "https://aisenseapi.com/" }

You can also encode other data formats, such as:

  • Plain Text
    { "payload": "Hello, World!" }
  • vCard (Contact Information)
    { "payload": "BEGIN:VCARD\nFN:John Doe\nTEL:+1234567890\nEND:VCARD" }
  • Wi-Fi Credentials
    { "payload": "WIFI:S:MyNetwork;T:WPA;P:mypassword;;" }
  • Event Details
    { "payload": "BEGIN:VEVENT\nSUMMARY:Meeting\nDTSTART:20230401T100000\nDTEND:20230401T110000\nEND:VEVENT" }

Use Cases

  • Generating QR codes for URLs, payment links, and authentication codes
  • Encoding plain text messages
  • Creating QR codes for contact cards (vCards)
  • Sharing Wi-Fi credentials securely
  • Embedding event details for calendar applications

How to Use

1. Send a POST request to

https://aisenseapi.com/services/v1/qrcode_encode

2. Provide the input as JSON

{ "payload": "https://aisenseapi.com/" }

Or for Wi-Fi credentials: json

{ "payload": "WIFI:S:MyNetwork;T:WPA;P:mypassword;;" }

3. Handle the response

  • If the input is valid, the response contains a Base64-encoded PNG representing the generated QR code.
  • If the input is missing or invalid, an error message is returned.

Example cURL Requests

Generate QR Code from a URL

curl -X POST https://aisenseapi.com/services/v1/qrcode_encode \
-H "Content-Type: application/json" \
-d '{"payload":"https://aisenseapi.com/"}'

Generate QR Code from Wi-Fi Credentials

curl -X POST https://aisenseapi.com/services/v1/qrcode_encode \
-H "Content-Type: application/json" \
-d '{"payload":"WIFI:S:MyNetwork;T:WPA;P:mypassword;;"}'

Generate QR Code from Contact Information

curl -X POST https://aisenseapi.com/services/v1/qrcode_encode \
-H "Content-Type: application/json" \
-d '{"payload":"BEGIN:VCARD\nFN:John Doe\nTEL:+1234567890\nEND:VCARD"}'

Key Features

  • Accepts JSON input to encode into a QR code
  • Supports encoding URLs, text, contact info, Wi-Fi credentials, events, and more
  • Returns the QR code as a Base64-encoded PNG
  • Ensures clear error handling for invalid input
  • No authentication required – free public API
Scroll to Top