Skip to content

Documentation

POST /v1/qr_code

A scannable QR code as SVG for a link or text, in your style and colours.

POST/v1/qr_codeTools

Encodes 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.

FieldTypeRequiredDescription
datastringrequiredWhat 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.
stylerounded | squareoptionalModule shape: rounded dots with rounded finder rings, or classic squares. Default rounded.
fgstringoptionalDark module colour as #rrggbb. Default #111111.
bgstringoptionalBackground colour as #rrggbb. Default #ffffff.
eccL | M | Q | HoptionalError correction: L 7%, M 15%, Q 25%, H 30% of the code can be damaged and still scan. Default M.
marginintegeroptionalQuiet zone around the code, in modules. The standard asks for 4. Default 4.
sizeintegeroptionalWidth 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

StatusMeaning
400The body is missing or invalid. `details` names each field.
401The API key is missing, malformed or revoked.
402The account has too few credits for this run. Buy a top-up or upgrade the plan.
413The input is larger than the plan allows per run. `details` carries the size, the limit and the unit.
429The key exceeded its requests-per-second limit. Honor the Retry-After header.
502An upstream the tool depends on failed. The credits were refunded.
504The run took longer than the tool's time limit. The credits were refunded.

Back to the guide