Hi
Product
Features
Security
Difference
Limits
FAQ
Pricing
Doc & Api
Get started free
NEXT-GEN LINK INFRASTRUCTURE

Stop guessing.
Start improving.

Deploy custom domains, ISO country routing, A/B split testing, PathLock™ PIN gates, and deterministic revenue attribution in under two minutes.

Get startedAccess our plans
Platform
  • Country & Device Routing
  • Weighted A/B Testing
  • Revenue Attribution (EPC)
  • Dynamic QR Studio
Security & Access
  • PathLock™ PIN Protection
  • Branded URL Masking
  • Click Limits & Expiration
  • Custom OpenGraph Cards
Developers
  • REST API & SDK Quickstart
  • Real-Time Click Telemetry
  • Signed Webhooks & Events
  • Full Documentation Hub
Legal & Trust
  • Privacy Policy (GDPR)
  • Terms of Service
  • No-Refund Policy
  • Dashboard Overview
LShorter Logo
LShorter© 2026 LShorter Inc.
Built on Cloudflare Edge Network
All 310+ Cloudflare Edge PoPs Operational
Privacy•Terms•Refunds
LShorter Logo
LShorter
HiHiProductProductFeaturesFeaturesSecuritySecurityDifferenceDifferenceLimitsLimitsFAQFAQPricingPricing
Doc & ApiDoc & Api
SDK & API Reference
Endpoints REST, clés Bearer et SDK TypeScript
Routage intelligent & Géo
Ciblage pays, OS mobile et redirection Edge
PathLock™ & Sécurité
Protection par code PIN, expiration et masquage
Télémétrie & Analytics
Flux de clics en direct, attribution et webhooks
RESSOURCESDocumentation

Documentation

Get started
LShorter Logo
LShorter
All guides & documentation

Dynamic QR Code Generation API

Create, customize, and stream infinite-resolution vector SVG and PNG QR codes dynamically.

3 min read•Official Edge Documentation
Dynamic QR Code Generation API

Overview & Architecture

A dynamic LShorter QR code encodes the permanent short URL rather than the final destination. You can update the target destination anytime via dashboard or API, even after millions of physical brochures, posters, or packaging materials have been printed.

Every physical scan is recorded in real-time telemetry with mobile scan differentiation and geographic origin tracking.

Key Principles

Core architectural pillars ensuring high performance, isolation, and security.

01Editable Without Re-Printing
Change the target destination URL of a printed QR code in one click with zero downtime.
02Vector SVG & High-Res PNG
Export infinite-resolution vector SVG for billboards and print media or PNG for digital displays.
03Error Correction Levels
Support for L, M, Q, and H error correction levels, allowing reliable scans even with center logo overlays.
SDK Integration

Implementation & SDK Examples

Ready-to-use TypeScript code snippets and configuration examples for your integrations.

1. Generating QR Codes via SDK

Download QR codes in SVG or PNG format:

get-qr-code.ts
typescript
12345678910111213
import { lshorter } from "@/lib/lshorter";
import fs from "node:fs/promises";
const qrSvg = await lshorter.qr.generate("launch-2026", {
format: "svg",
size: 512,
errorCorrectionLevel: "H",
darkColor: "#ff6600",
lightColor: "#FAF7F2",
});
await fs.writeFile("qr-launch.svg", qrSvg);
console.log("Vector SVG QR Code exported successfully!");
REST API Specification

API Endpoints & Reference

Direct HTTP request methods, parameters schema, authentication, and responses.

GET

Generate Dynamic QR Code

Bearer <API_KEY>60 to 1,400 req/min (by plan)
https://lsho.cc/api/v1/qr/:slug

Streams a customized dynamic QR code image in SVG or PNG format.

Path Parameters

ParameterTypeRequiredDescriptionExample
slugstringRequiredShort link slug alias.launch-2026

Query Parameters

ParameterTypeRequiredDescriptionExample
formatstring (svg | png)OptionalImage output format.Default: svgsvg
sizenumberOptionalImage dimension in pixels (for PNG) or viewBox size (for SVG).Default: 512512
errorCorrectionLevelstring (L | M | Q | H)OptionalQR code redundancy level (H = 30% damage tolerance).Default: MH
darkColorstring (hex)OptionalHex color code for the foreground QR dots.Default: #000000#ff6600
lightColorstring (hex)OptionalHex color code for the background.Default: #ffffff#FAF7F2
marginnumberOptionalQuiet zone border margin width in modules.Default: 22

Request Examples

bash
123
curl -X GET "https://lsho.cc/api/v1/qr/launch-2026?format=svg&size=512&darkColor=%23ff6600" \
-H "Authorization: Bearer $LSHORTER_API_KEY" \
--output qr-launch.svg

Response Payload

200 OKBinary image payload (image/svg+xml or image/png).
response-200.json
json
12345
// Content-Type: image/svg+xml or image/png
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<rect width="100%" height="100%" fill="#FAF7F2"/>
<path d="M0 0h140v140H0z..." fill="#ff6600"/>
</svg>

Recommended Best Practices

Expert tips to maximize performance, resilience, and link security.

Recommendation 01

Use error correction level 'H' (30% redundancy) whenever placing a custom brand logo or icon in the center of the QR code.

Recommendation 02

Always choose SVG vector format for print and packaging designs to guarantee razor-sharp edges at any physical dimension.

Recommendation 03

Test QR readability across both iOS (native Camera app) and Android scanner apps before initiating physical print production.

Previous guideBranded URL Masking & White-Label EmbeddingNext guideWebhooks & Real-Time Events API

Related Guides & APIs

Quickstart & REST API Reference
Quickstart & REST API Reference
Integrate intelligent edge link shortening, real-time analytics, and conversion tracking with our high-performance REST API and TypeScript SDK.
Read guide & API
Dynamic Routing & Edge Geolocation
Dynamic Routing & Edge Geolocation
Redirect visitors to contextual URLs based on their origin country or continent with ultra-low latency.
Read guide & API