Skip to content
API Documentation
GET/v2/qr/:shortCode

Generates a QR code image for a specific shortened URL with API key authentication. The QR code links directly to the frontend short URL (e.g., https://plung.co/:shortCode). Supports PNG and SVG formats.

Requires API key: This endpoint requires authentication via the Authorization header with a Bearer token. See the Authentication page for details.
Canonical renderer: This endpoint uses the same backend QR renderer as the public frontend, so API downloads and in-product downloads stay aligned on format, payload, and cache behavior.

Request Headers

ParameterTypeRequiredDescription
AuthorizationstringRequiredYour API key as a Bearer token in the Authorization header. Returns a 401 error if missing, invalid, or revoked.

Path Parameters

ParameterTypeRequiredDescription
shortCodestringRequiredThe unique short code generated when the URL was shortened. Must contain only alphanumeric characters and hyphens.

Query Parameters

ParameterTypeRequiredDescription
formatstringOptionalThe returned image format. Accepted values: png, svg. Default is png.
sizeintegerOptionalThe width and height of the QR code in pixels. Accepted values: between 100 and 1000. Default is 300.

Request Examples

bash
curl -o qr.png -H "Authorization: Bearer your_api_key_here" \
  "https://api.plung.co/v2/qr/abc12345?format=png&size=500"

Success Response

Status: 200 OK

The response is a raw image buffer (image/png or image/svg+xml), not a JSON object. The endpoint includes Cache-Control headers.

Error Responses

StatusCauseMessage
400Invalid parameters or QR generation disabled for the platform"format must be either png or svg" / "QR code generation is currently disabled on this platform"
401Missing API key"API key required. Pass your key as: Authorization: Bearer <your-key>"
401Invalid or inactive API key"Invalid or inactive API key."
404No URL found with this short code"Short URL not found"
410The shortened link has expired"This shortened link has expired"
429Rate limit exceeded"Rate limit exceeded. Try again in the next minute."
Generated QR codes are cached in Redis for 24 hours to improve performance. Subsequent requests with the exact same parameters will hit the cache.