Skip to main content

Generate QR Code Image

Generate a QR code image in PNG, SVG, or JPG format.

GET/qr-codes/:id/image

Headers

HeaderRequiredDescription
X-API-KeyRequiredYour API key
QR-VersionOptionalAPI version (e.g., 2026-02-16)

Path Parameters

ParameterTypeDescription
idstringThe QR code ID (e.g., qr-aBc123XyZ9)

Query Parameters

ParameterTypeDefaultDescription
formatstringpngImage format: png, svg, or jpg
sizeinteger300Image width and height in pixels (100–3000)

Response Headers

HeaderDescription
Content-TypeThe MIME type of the image
Cache-Controlpublic, max-age=86400 — images are cached for 24 hours
info

Images are automatically regenerated when you update the QR code's design or content. Cached images are invalidated on update.

tip

Use the Design Builder to visually customize your QR code style before creating it via the API.

Format Guide

FormatUse case
PNG (default)Best for web and general use, supports transparency, highest quality
SVGScalable vector, smallest file size, ideal for print and resolution-independent use
JPGSmaller file size, no transparency, good for embedding and photos
  • Size 100–3000px. Default 300. Use 600–1000 for high-resolution web, 1500–3000 for print.

Request

# PNG (default)
curl -X GET "https://integration-api.qr-build.com/qr-codes/qr-aBc123XyZ9/image" \
-H "X-API-Key: qrb_live_your_api_key_here" \
--output qr-code.png

# SVG
curl -X GET "https://integration-api.qr-build.com/qr-codes/qr-aBc123XyZ9/image?format=svg" \
-H "X-API-Key: qrb_live_your_api_key_here" \
--output qr-code.svg

# JPG with custom size
curl -X GET "https://integration-api.qr-build.com/qr-codes/qr-aBc123XyZ9/image?format=jpg&size=1000" \
-H "X-API-Key: qrb_live_your_api_key_here" \
--output qr-code.jpg

Response

Returns binary image data with the appropriate Content-Type header.

FormatContent-Type
pngimage/png
svgimage/svg+xml
jpgimage/jpeg

Error — Not Found

{
"success": false,
"error": {
"code": "QR_NOT_FOUND",
"message": "QR code not found"
}
}

Error — Validation

{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid format. Must be one of: png, svg, jpg"
}
}