Static vs Dynamic QR Codes
Before diving in, let's understand the difference:
- Static QR Codes: Encode the destination URL directly. Once printed, they can never change.
- Dynamic QR Codes: Point to a redirect URL that you control. Change the destination anytime without reprinting.
How Dynamic QR Codes Work
The redirect URL stays the same, but you can change where it points.
Creating a Dynamic QR Code
Use the Links API to create a dynamic link, then generate a QR code for it:
const response = await fetch('https://www.qrcodeapi.io/api/links', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Summer Menu 2024',
destinationUrl: 'https://yoursite.com/menu/summer'
})
});
const link = await response.json();
// link.shortCode = 'abc123'
// link.qrUrl = 'https://www.qrcodeapi.io/r/abc123'
const qrResponse = await fetch('https://www.qrcodeapi.io/api/generate', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: link.qrUrl, // Use the redirect URL
size: 400,
format: 'png'
})
});
// Print this QR code - it will always redirect through your dynamic link
Updating the Destination
When you need to change where the QR code points, simply update the link:
await fetch(`https://www.qrcodeapi.io/api/links?id=${link.id}`, {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
destinationUrl: 'https://yoursite.com/menu/fall' // New destination
})
});
// All existing QR codes now redirect to the new URL!
Use Cases for Dynamic QR Codes
Restaurant Menus
Print QR codes on table tents once. Update menus daily for specials, seasonal items, or price changes without reprinting.
Marketing Campaigns
Print QR codes on flyers or billboards. Redirect to different landing pages based on campaign phase or A/B tests.
Product Packaging
Include QR codes on packaging that link to user guides, warranty registration, or promotional offers that change over time.
Real Estate
Same yard sign QR code can redirect to different property listings as homes sell and new ones come on market.
Benefits of Dynamic QR Codes
- Cost savings: No reprinting when destinations change
- Flexibility: Update instantly from your dashboard or API
- Analytics: Track scans, locations, devices, and time patterns
- Error correction: Fix broken links without reprinting
- A/B testing: Test different destinations with the same QR code
Ready to Create Dynamic QR Codes?
Get started with dynamic links and never reprint a QR code again.
Get Your Free API Key