QR Code API: Generate QR Codes Programmatically
Generate QR codes via HTTP API — no UI required. Free options exist for static QR codes. For dynamic, trackable QR codes in production apps, a paid API key is recommended.
Free QR code API — quick start
The fastest way to generate a QR code via API is the free goqr.me / QRServer endpoint — no API key required:
cURL
curl "https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://yoursite.com" -o qr.png
JavaScript (fetch)
const res = await fetch(
"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=" +
encodeURIComponent("https://yoursite.com")
);
const blob = await res.blob(); // PNG imagePython
import requests, urllib.parse
url = "https://yoursite.com"
api = f"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data={urllib.parse.quote(url)}"
r = requests.get(api)
open("qr.png", "wb").write(r.content)Returns a PNG image directly. Supported parameters: size (e.g. 300x300), data (URL-encoded), format (png/svg/eps), color, bgcolor, ecc (error correction: L/M/Q/H).
Free vs. paid API
| Feature | Free API | Paid API |
|---|---|---|
| Static QR generation | ✓ | ✓ |
| Authentication required | No | API key |
| Dynamic (editable) QR | ✗ | ✓ |
| Scan analytics | ✗ | ✓ |
| Custom logo in center | ✗ | ✓ |
| Rate limits | Low–moderate | Higher / unlimited |
| SLA / uptime guarantee | None | Yes (paid plans) |
Common questions
Is there a free QR code API?
Yes. Several free QR code APIs exist including goqr.me's public API (no auth required), QRServer, and others. Free tiers typically support static QR code generation. Dynamic QR codes with tracking require a paid API key.
What can a QR code API generate?
Most QR code APIs generate URL QR codes by passing a URL parameter. Advanced APIs support vCard, WiFi credentials, email, SMS, calendar events, and more. Output formats typically include PNG, SVG, and sometimes PDF.
How do I generate a QR code via API?
A basic QR code API call is an HTTP GET request with your data as a URL parameter. Example: GET https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=https://yoursite.com — returns a PNG image directly.
What's the difference between a free and paid QR code API?
Free APIs generate static QR codes with no analytics. Paid APIs add: dynamic QR codes (editable destination), scan tracking, bulk generation, custom logos, and higher rate limits. For production apps with tracking needs, a paid API is required.
Can I embed a QR code generator in my app?
Yes — via API or by using an open-source QR library directly in your app (qrcode.js for JavaScript, python-qrcode for Python, zxing for Java/Android). For server-side generation at scale, an API is more practical.