🔳 QRGen API

QR Code Generator

×
Color BG

📱 Quick Examples

🌐 Website: example.com
📝 Text: Hello World!
📧 Email: admin@example.com
📞 Phone: +6281234567890

🖼️ Generate QR Code (PNG Image)

Endpoint: /api/qr

Method: GET

Query Parameters:

  • data (required): The data to encode in the QR code
  • size: Size in format WIDTHxHEIGHT (default: 300x300)
  • margin: Margin around QR code (0-10, default: 1)
  • el: Error correction level (L, M, Q, H, default: M)
  • color: Color in hex (default: #000000)
  • bgcolor: Background color in hex (default: #FFFFFF)

Example Request:

GET /api/qr?data=https://example.com&size=300x300&margin=2&el=H&color=000000&bgcolor=FFFFFF

🔤 Generate QR Code (Data URL)

Endpoint: /api/qr/url

Method: GET

Query Parameters: Same as above

Example Request:

GET /api/qr/url?data=Hello%20World&size=400x400&margin=1&el=Q&color=000000&bgcolor=FFFFFF

Response:

{
  "success": true,
  "data": {
    "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...",
    "size": "400x400",
    "content": "Hello World"
  }
}

📦 Batch QR Code Generation

Endpoint: /api/qr/batch

Method: POST

Request Body:

{
  "requests": [
    { "data": "batch-test-1", "size": "200x200" },
    { "data": "batch-test-2", "size": "300x300" },
    { "data": "batch-test-3", "size": "400x400" }
  ]
}
  • Maximum 50 requests per batch.
  • Each request object supports the same parameters as /api/qr.

Example Request:

POST /api/qr/batch
Content-Type: application/json

{
  "requests": [
    { "data": "batch-test-1", "size": "200x200" },
    { "data": "batch-test-2", "size": "300x300" },
    { "data": "batch-test-3", "size": "400x400" }
  ]
}

Example Response:

{
  "success": true,
  "processed": 3,
  "successful": 3,
  "failed": 0,
  "results": [
    {
      "index": 0,
      "success": true,
      "data": {
        "url": "data:image/png;base64,...",
        "size": "200x200",
        "content": "batch-test-1"
      }
    }
    // ...
  ]
}

Error Response (Batch Too Large):

{
  "error": "Batch size too large",
  "message": "Maximum 50 requests per batch",
  "received": 60,
  "maximum": 50
}

❌ Error Responses

400 Bad Request:

{
  "error": "Data parameter is required",
  "example": "/api/qr?data=example.com&size=300x300"
}

500 Internal Server Error:

{
  "error": "Failed to generate QR code",
  "details": "Error message details"
}