QR Encoder
API key v1Generate a QR code as PNG, JPG, SVG or text.
Generates a QR code from any text or URL and returns a hosted image, inline SVG markup, or the raw matrix as text. Images are kept at the returned URL, so you can hot-link them directly.
https://api.zactonz.com/qr/enc/
Parameters
| Name | Type | Description |
|---|---|---|
contentrequired |
string |
The text or URL to encode. URL-encode it when it contains |
format |
enum |
Output format. pngjpgsvgtext |
size |
integer |
Pixels per QR module, from Default
4 |
accuracy |
enum |
Error-correction level. Higher levels survive more damage but produce denser codes. lownormalgoodhigh |
padding |
integer |
Quiet-zone margin around the code, in modules. Default
2 |
color |
hex |
Foreground colour as a hex value, e.g. Default
000000 |
bgcolor |
hex |
Background colour as a hex value. Default
FFFFFF |
resp |
enum |
jsonimage |
Send parameters in the query string.
Response
A successful reply wraps the result in `data`.
| Field | Type | Description |
|---|---|---|
status |
integer |
|
data |
object | |
data.qr |
string | Absolute URL of the generated image ( |
data.text |
string | Inline SVG markup or the text matrix ( |
data.size |
integer | Module size that was applied. |
data.accuracy |
string | Error-correction level as a single letter: |
data.format |
string | Output format that was applied. |
Status codes
The outcome is reported in the JSON status field. See Errors & status codes for the general rules.
200 |
OK | The code was generated. |
400 |
Missing content |
|
500 |
Encoding failed | The encoder could not build the matrix. Shorten the content or lower |
Notes
The endpoint sends Access-Control-Allow-Origin: *. Call it from your backend all the same, so your API key never reaches the browser.
With format=svg or format=text the markup is returned inline in data.text instead of a hosted file. With resp=image the image bytes are streamed directly, which makes the URL usable as an <img src>.