POST /v1/codes/qr-generate
QR code
PNG or crisp SVG, with the error-correction level and size under your control.
Make a QR code now No key, no code — 2 credits either way.
curl -X POST "$DOATHING_API/v1/codes/qr-generate" \
-H "x-api-key: $DOATHING_KEY" \
-H "content-type: application/json" \
-d '{"text": "https://doathing.com", "options": {"error_correction": "Q"}}'
PNG or crisp SVG, with the error-correction level and size under your control.
Generate a QR code as PNG or SVG with configurable error correction, scale, border and colours.
Response
The result carries your remaining balance alongside it, so you can track spend without a second call.
{
"version": 2,
"modules": 25,
"error_correction": "Q",
"contrast_ratio": 21.0,
"request_id": "37f01edb-0163-42a1-ac51-0acaef979800",
"credits_remaining": 96
}
Cost
2 credits per call, whether it is run from the site or from the API — the credential differs, the price does not. A new account starts with 20 credits.
A rejected request still costs a credit: the authorizer decrements before the tool validates. A call rejected for a missing or invalid key is free.
Parameters
Generated from the endpoint’s own validation, so this is exactly what it accepts. A body field goes at the top level; an option goes inside options.
| Name | In | Type | Default | Notes |
|---|---|---|---|---|
| text * | body | string | — | |
| error_correction | options | string | "M" | L, M, Q or H. Higher survives more damage and makes a denser code. one of L, M, Q, H |
| format | options | string | "png" | png or svg. one of png, svg |
| scale | options | integer | 8 | Pixels per module. 1 to 40 |
| border | options | integer | 4 | Quiet-zone width in modules. Four is the standard. 0 to 20 |
| dark | options | string | "#000000" | #RRGGBB for the modules. |
| light | options | string | "#FFFFFF" | #RRGGBB for the background. |