← All microservices
QR code generator
Codes
Make a QR code from a URL or text, as PNG or SVG, in your colours, with your logo in the centre if you like.
What it does
- PNG or SVG, up to 2048 pixels
- Your colours, or a transparent background
- Your logo in the centre
- Four error correction levels
Good for
- Menus and posters
- Tickets and labels
- Wi-Fi details
Codes are drawn on whole pixels, so they stay sharp and scan reliably. Adding a logo raises error correction automatically to keep them readable.
Example
GETPOST https://bloodweb.net/api/v1/qr-generate
curl -H "Authorization: Bearer YOUR_KEY" "https://bloodweb.net/api/v1/qr-generate?data=https://example.com&size=300" -o qr.png
Options
| Name | Description |
|---|---|
logofile |
Optional, POST only: an image to place in the centre, up to 5MB. Error correction is raised to H so the code still scans. |
data
required |
What the code holds: a URL, text, a vCard, a Wi-Fi string. |
format
|
Image format. One of: png, svg Default: png |
size
|
Width and height in pixels, including the margin. Default: 512 |
margin
|
Quiet zone around the code, in modules. Scanners want 4; less works on plain backgrounds. Default: 4 |
ecc
|
Error correction: L 7%, M 15%, Q 25%, H 30%. Higher survives damage or a logo, but makes a denser code. One of: L, M, Q, H Default: M |
color
|
Module colour. Default: #000000 |
background
|
Background colour, or "transparent". Default: #ffffff |
logo_size
|
Logo width as a percentage of the code. Bigger logos are harder to scan. Default: 22 |
Returns
image/png or image/svg+xml.
Limits
data up to 2,000 characters.