Documentation
POST /v1/qr_code
A scannable QR code as SVG for a link or text, in your style and colours.
POST
/v1/qr_codeToolsEncodes a link or text as a static QR code and returns it as a standalone SVG. Picks the smallest version that fits, draws rounded or square modules in your colours, sets the error correction level and quiet zone, and reports the contrast between the colours with a warning when phones may struggle to scan it. Costs 1 credit per code. Input size is counted in characters; the per-run limit depends on the plan. Also available as the MCP tool snip_qr_code.
Request body
JSON, sent with Content-Type: application/json.
| Field | Type | Required | Description |
|---|---|---|---|
data | string | required | What the code holds: a link, plain text, or a Wi-Fi, vCard, mailto: or tel: payload. 1 to 2,953 bytes of UTF-8; the most it can hold drops at higher error correction. Size limits are counted in characters and depend on your plan. |
style | rounded | square | optional | Module shape: rounded dots with rounded finder rings, or classic squares. Default rounded. |
fg | string | optional | Dark module colour as #rrggbb. Default #111111. |
bg | string | optional | Background colour as #rrggbb. Default #ffffff. |
ecc | L | M | Q | H | optional | Error correction: L 7%, M 15%, Q 25%, H 30% of the code can be damaged and still scan. Default M. |
margin | integer | optional | Quiet zone around the code, in modules. The standard asks for 4. Default 4. |
size | integer | optional | Width and height attributes of the SVG, in pixels. The drawing is vector and scales without loss. Default 1024. |
Example request
curl -s "https://snip.link/v1/qr_code" \
-H "Authorization: Bearer $SNIP_KEY" \
-H "Content-Type: application/json" \
-d '{"data":"https://snip.link/spring-menu?qr=1"}'Errors
| Status | Meaning |
|---|---|
| 400 | The body is missing or invalid. `details` names each field. |
| 401 | The API key is missing, malformed or revoked. |
| 402 | The account has too few credits for this run. Buy a top-up or upgrade the plan. |
| 413 | The input is larger than the plan allows per run. `details` carries the size, the limit and the unit. |
| 429 | The key exceeded its requests-per-second limit. Honor the Retry-After header. |
| 502 | An upstream the tool depends on failed. The credits were refunded. |
| 504 | The run took longer than the tool's time limit. The credits were refunded. |