API Documentation
GET
/v2/qr/:shortCodeGenerates 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
| Parameter | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Required | Your API key as a Bearer token in the Authorization header. Returns a 401 error if missing, invalid, or revoked. |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| shortCode | string | Required | The unique short code generated when the URL was shortened. Must contain only alphanumeric characters and hyphens. |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| format | string | Optional | The returned image format. Accepted values: png, svg. Default is png. |
| size | integer | Optional | The 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
| Status | Cause | Message |
|---|---|---|
400 | Invalid parameters or QR generation disabled for the platform | "format must be either png or svg" / "QR code generation is currently disabled on this platform" |
401 | Missing API key | "API key required. Pass your key as: Authorization: Bearer <your-key>" |
401 | Invalid or inactive API key | "Invalid or inactive API key." |
404 | No URL found with this short code | "Short URL not found" |
410 | The shortened link has expired | "This shortened link has expired" |
429 | Rate 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.