Skip to content

QR Code

Generate a QR code image from any string content, with configurable format, size, colors, and error correction level.

FieldTypeRequiredDefaultDescription
contentstringYesContent to encode
formatstringNopngpng or svg
sizeintegerNo256Pixel size (max 2048)
foregroundstringNo#000000Foreground hex color
backgroundstringNo#FFFFFFBackground hex color
error_levelstringNoError correction: L (7%), M (15%), Q (25%), H (30%)

Binary image data with the appropriate Content-Type header (image/png or image/svg+xml).

Terminal window
curl -X POST https://morso.dev/api/qr-code \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"content": "https://morso.dev"}' \
-o qr.png
Terminal window
curl -X POST https://morso.dev/api/qr-code \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"content": "https://morso.dev", "format": "svg", "size": 512, "foreground": "#1a1a2e", "background": "#e2e2e2", "error_level": "H"}' \
-o qr.svg
  • 400 — Missing content, invalid format, invalid color, or size exceeds limit.

See Errors for the standard error shape.