Generate QR Code Image
Generate a QR code image in PNG, SVG, or JPG format.
GET
/qr-codes/:id/imageHeaders
| Header | Required | Description |
|---|---|---|
X-API-Key | Required | Your API key |
QR-Version | Optional | API version (e.g., 2026-02-16) |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The QR code ID (e.g., qr-aBc123XyZ9) |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
format | string | png | Image format: png, svg, or jpg |
size | integer | 300 | Image width and height in pixels (100–3000) |
Response Headers
| Header | Description |
|---|---|
Content-Type | The MIME type of the image |
Cache-Control | public, 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
| Format | Use case |
|---|---|
| PNG (default) | Best for web and general use, supports transparency, highest quality |
| SVG | Scalable vector, smallest file size, ideal for print and resolution-independent use |
| JPG | Smaller 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
- cURL
- JavaScript
- Python
# 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
const response = await fetch(
"https://integration-api.qr-build.com/qr-codes/qr-aBc123XyZ9/image?format=png&size=500",
{ headers: { "X-API-Key": "qrb_live_your_api_key_here" } }
);
const imageBuffer = await response.arrayBuffer();
fs.writeFileSync("qr-code.png", Buffer.from(imageBuffer));
import requests
response = requests.get(
"https://integration-api.qr-build.com/qr-codes/qr-aBc123XyZ9/image",
headers={"X-API-Key": "qrb_live_your_api_key_here"},
params={"format": "png", "size": 500},
)
with open("qr-code.png", "wb") as f:
f.write(response.content)
Response
Returns binary image data with the appropriate Content-Type header.
| Format | Content-Type |
|---|---|
png | image/png |
svg | image/svg+xml |
jpg | image/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"
}
}