ใส่ข้อความเพื่อสร้าง QR
REST API
Endpoint สำหรับเรียกใช้ในระบบของคุณ:
GET /api/qr?text=<text>
POST /api/qr { "text": "...", "format": "png" }
พารามิเตอร์
| ชื่อ | ค่า | คำอธิบาย |
|---|---|---|
| text | string | ข้อความหรือ URL (สูงสุด 4096) |
| format | png \| svg \| json \| txt | ค่าเริ่มต้น png |
| size | 64–2000 | ขนาดเป็น px (เริ่มต้น 300) |
| margin | 0–20 | ขอบขาว (เริ่มต้น 2) |
| ec | L \| M \| Q \| H | ระดับแก้ไขข้อผิดพลาด |
| dark | #hex | สีจุด QR |
| light | #hex | สีพื้นหลัง |
ตัวอย่าง
# PNG
curl "https://YOUR_DOMAIN/api/qr?text=https://example.com&size=512" -o qr.png
# SVG
curl "https://YOUR_DOMAIN/api/qr?text=hello&format=svg" -o qr.svg
# JSON (data URL)
curl "https://YOUR_DOMAIN/api/qr?text=hello&format=json"
# POST
curl -X POST https://YOUR_DOMAIN/api/qr \
-H "Content-Type: application/json" \
-d '{"text":"hello","format":"png","size":600}' -o qr.png