📱 QR Code Generator API

Generate QR codes for text, URLs, vCards, events, Wi-Fi & phone numbers

📖 Overview

The QR Code Generator API produces high-quality QR codes from a wide variety of content types. It assembles standards-compliant payloads (vCard 3.0, iCalendar, WIFI:, tel: …) and then asks goQR.me to render the picture — so all configuration parameters from the official goQR.me spec are supported.

📝 Plain Text

Any short or long text — perfect for notes, messages or short URLs.

👤 Business vCard

vCard 3.0 with full personal, organisational and address fields.

📅 Events

iCalendar (vCalendar) events with start/end, location and description.

🌐 Websites

Plain URL — the QR opens the link when scanned.

📶 Wi-Fi

WIFI: payload with SSID, password, encryption type and hidden flag.

📞 Phone Numbers

tel: URI — scanners prompt the user to call the number.

Underlying engine: All rendering is delegated to the goQR.me create-qr-code API. This service is provided free of charge by Foundata GmbH and supports size, ECC, colour, background, margin, quiet zone, charset and format parameters — all of which you can pass straight through to this endpoint.

🌐 Base URL

https://api.lorwongam.com/api/qr-code-generator/

🔐 Authentication

No authentication required. The endpoint is public and CORS-enabled.

📡 Endpoints

POST / Generate a QR code

Generate a QR code with a payload of any supported content type.

Core Parameters

ParameterTypeRequiredDescription
type string Required One of: text, url, vcard, event, wifi, phone
format string Optional Response format — image (raw PNG) or json (default)

Type-Specific Fields

TypeFieldDescription
text text Plain text payload
url url Website URL (auto-prefixed with https:// if missing)
phone phone Phone number (any format)
vcard first_name First name (required with last name, or supply organization)
last_name Last name
organization Company
title Job title
work_email Work email (single)
home_email Personal email (single)
work_phone Work phone (single)
home_phone Home phone (single)
mobile Mobile phone (single)
fax Fax (single)
website Personal / business website (single)
address Street address (single)
city City (single)
region Region / state / province (single)
postcode Postal / ZIP code (single)
country Country (single)
note Free-form note
event summary Event title (required)
start Start date/time (YYYY-MM-DD or YYYY-MM-DD HH:MM, required)
end End date/time (defaults to +1h after start)
location Event location
description Event description
wifi ssid Network name (required)
password Wi-Fi password
encryption WPA (default), WEP, or nopass
hidden 1 for hidden network, 0 otherwise

Appearance / goQR.me Parameters

All parameters documented at goQR.me are supported and forwarded as-is.

ParameterDefaultDescription
size 300 Pixel size: [int]x[int] (50–1000)
ecc M Error correction: L (7%), M (15%), Q (25%), H (30%)
qzone 2 Quiet zone in modules (0–100, recommended ≥1)
margin 1 Pixel margin around the QR (0–50)
color 0-0-0 Foreground RGB — decimal R-G-B or hex (000000)
bgcolor 255-255-255 Background RGB
charset_source UTF-8 UTF-8 or ISO-8859-1
charset_target UTF-8 UTF-8 or ISO-8859-1
file_type png Renderer output format: png, svg, gif, jpeg or eps. (Legacy alias: gformat.) See goQR.me

Dynamic vCard Fields (vCard type only)

For type=vcard you can supply multiple emails, phones, URLs and structured addresses using array notation. Each entry is emitted as a separate EMAIL;TYPE=…, TEL;TYPE=…, URL or ADR;TYPE=… line in the vCard payload.

Field PatternSub-keysDescription
emails[i][value] type: WORK / HOME / INTERNET One email per row. Multiple rows supported via index i = 0, 1, 2 …
phones[i][value] type: CELL,VOICE / WORK,VOICE / HOME,VOICE / FAX / VOICE One phone per row.
urls[i][value] label: optional display label (not embedded in vCard) One URL per row.
addresses[i][…] type (WORK / HOME / OTHER), street, po_box, city, region, postcode, country One full address per row.

Indexes can be sparse — the server normalises and packs them densely before emitting the vCard. Legacy single fields (work_email, home_phone, …) are still accepted for backward compatibility and are merged with the dynamic arrays.

💡 Example Requests

1) Plain Text

curl -X POST "https://api.lorwongam.com/api/qr-code-generator/?format=json" \ -d "type=text" \ -d "text=Hello%20World%21"

2) Website URL

curl -X POST "https://api.lorwongam.com/api/qr-code-generator/?format=json" \ -d "type=url" \ -d "url=https://github.com/luozongbao/myapis"

3) Business vCard

curl -X POST "https://api.lorwongam.com/api/qr-code-generator/?format=json" \ -d "type=vcard" \ -d "first_name=John" \ -d "last_name=Doe" \ -d "organization=Acme%20Inc." \ -d "title=CTO" \ -d "[email protected]" \ -d "mobile=%2B66812345678" \ -d "website=https://acme.example" \ -d "address=123%20Main%20St" \ -d "city=Bangkok" \ -d "country=Thailand"

4) Calendar Event

curl -X POST "https://api.lorwongam.com/api/qr-code-generator/?format=json" \ -d "type=event" \ -d "summary=Quarterly%20Review" \ -d "start=2026-09-15%2014:00" \ -d "end=2026-09-15%2016:00" \ -d "location=Boardroom%2C%204F" \ -d "description=Agenda%3A%20Roadmap%2C%20KPIs"

5) Wi-Fi Network

curl -X POST "https://api.lorwongam.com/api/qr-code-generator/?format=json" \ -d "type=wifi" \ -d "ssid=CafeFreeWiFi" \ -d "password=drinkmorecoffee" \ -d "encryption=WPA"

6) Phone Number

curl -X POST "https://api.lorwongam.com/api/qr-code-generator/?format=json" \ -d "type=phone" \ -d "phone=%2B66%2081%20234%205678"

7) Direct PNG Image with Custom Dimension

curl "https://api.lorwongam.com/api/qr-code-generator/?format=image&type=text&text=Scan%20me&size=500x500&ecc=H&qzone=4" \ --output qr.png

8) SVG Output with Custom Colours

curl "https://api.lorwongam.com/api/qr-code-generator/?format=image&type=text&text=Hello" \ -d "file_type=svg" \ -d "color=cc0066" \ -d "bgcolor=ffffcc" \ -d "size=400x400" \ --output qr.svg

9) Dynamic vCard with Multiple Emails / Phones / Addresses

curl -X POST "https://api.lorwongam.com/api/qr-code-generator/?format=json" \ -d "type=vcard" \ -d "first_name=Jane" -d "last_name=Doe" \ -d "emails[0][type]=WORK" -d "emails[0][value][email protected]" \ -d "emails[1][type]=HOME" -d "emails[1][value][email protected]" \ -d "phones[0][type]=CELL,VOICE" -d "phones[0][value]=+66811234567" \ -d "phones[1][type]=WORK,VOICE" -d "phones[1][value]=+6623456789" \ -d "addresses[0][type]=WORK" -d "addresses[0][street]=123 Sukhumvit" \ -d "addresses[0][city]=Bangkok" -d "addresses[0][country]=Thailand"

📊 Response Format

JSON response (default)

{ "success": true, "message": "QR code generated successfully", "type": "vcard", "payload": "BEGIN:VCARD\r\nVERSION:3.0\r\nN:Doe;John;;;\r\nFN:John Doe\r\nORG:Acme Inc.\r\nTITLE:CTO\r\nTEL;TYPE=CELL,VOICE:+66812345678\r\nEMAIL;TYPE=WORK:[email protected]\r\nURL:https://acme.example\r\nADR;TYPE=WORK:;;123 Main St;Bangkok;;;Thailand\r\nEND:VCARD", "qr_url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...", "goqr_url": "https://api.qrserver.com/v1/create-qr-code/?...", "params": { "size": 300, "ecc": "M", "format": "png", "qzone": 2, "margin": 1, "charset-source": "UTF-8", "charset-target": "UTF-8", "color": "0-0-0", "bgcolor": "255-255-255" }, "file_type": "png" }

Image response (format=image)

Returns the raw PNG bytes directly (Content-Type image/png).

⚠️ Error Codes

HTTPDescription
200Success
400Bad Request — missing required field or unknown type
500Internal Server Error — goQR.me upstream issue

🔗 Reference

Full parameter reference lives at the official goQR.me documentation: goQR.me API ↗